Mercurial > eagle-eye
comparison pyikriam/createAccount.py @ 222:4a051d178456
mreged.
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Tue, 04 Nov 2008 18:33:49 +0800 |
parents | 5fa938cbe058 |
children | f3502833be7c |
comparison
equal
deleted
inserted
replaced
221:1b7805535040 | 222:4a051d178456 |
---|---|
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 |