Mercurial > eagle-eye
comparison pyikriam/createAccount.py @ 220:5fa938cbe058
Class of account creater
author | kevin@tombear.tombears.com |
---|---|
date | Tue, 04 Nov 2008 18:28:28 +0800 |
parents | |
children | f3502833be7c |
comparison
equal
deleted
inserted
replaced
219:7107c26ba197 | 220:5fa938cbe058 |
---|---|
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 |