220
|
1 import urllib2,urllib
|
|
2
|
|
3 from ikariam import fake_moz
|
|
4 from lazy.www import c
|
|
5
|
|
6 class CreateAccount:
|
|
7 """
|
|
8 For create sheep to cheat. take care of the ip address & email check by yourself.
|
|
9 """
|
|
10 def __init__(self,account,email,password,server):
|
|
11 self.account=account
|
|
12 self.password=password
|
|
13 self.server=server
|
|
14 self.email=email
|
|
15 headers=[('Referer','http://'+self.server[self.server.find('.')+1:]+'/register.php')]
|
|
16 self.browser = fake_moz(headers)
|
|
17 urllib2.install_opener(self.browser)
|
|
18 pass
|
|
19
|
|
20 def ca(self):
|
|
21 self.baseurl='http://'+self.server
|
|
22 params = {
|
|
23 "function":"createAvatar",\
|
|
24 "name":self.account,\
|
|
25 "email":self.email,\
|
|
26 "password":self.password,\
|
|
27 "agb":"on"}
|
|
28 self.ret=c(self.baseurl+'/index.php?action=newPlayer').get(params).get_content()
|
|
29 pass
|
|
30
|
|
31 class confirme:
|
|
32 def __init__(self,confirmeurl):
|
|
33 self.confirmeurl=confirmeurl
|
|
34 self.browser = fake_moz()
|
|
35 urllib2.install_opener(self.browser)
|
|
36 pass
|
|
37
|
|
38 def run(self):
|
|
39 self.ret=c(self.confirmeurl).get().get_content()
|
|
40 pass
|
|
41
|
|
42 """
|
|
43 ikariamca=CreateAccount('someac','kevin@butyshop.com','contest123','s2.ikariam.tw')
|
|
44 a=ikariamca.ca()
|
|
45 confirme("http://s2.ikariam.tw/index.php?action=newPlayer&function=validateEmail&hash=c239c92a94690066078ca95c993d348b&id=70997").run()
|
|
46 """
|
|
47
|