comparison pyikriam/ikariam.py @ 220:5fa938cbe058

Class of account creater
author kevin@tombear.tombears.com
date Tue, 04 Nov 2008 18:28:28 +0800
parents 7107c26ba197
children f3502833be7c
comparison
equal deleted inserted replaced
219:7107c26ba197 220:5fa938cbe058
22 opener.addheaders = fakeheaders 22 opener.addheaders = fakeheaders
23 fake_moz.set_backend(self, opener) 23 fake_moz.set_backend(self, opener)
24 self.cookie_jar = cookie_jar 24 self.cookie_jar = cookie_jar
25 pass 25 pass
26 pass 26 pass
27
28 class CreateAccount:
29 """
30 For create sheep to cheat. take care of the ip address & email check by yourself.
31 """
32 def __init__(self,account,email,password,server):
33 self.account=account
34 self.password=password
35 self.server=server
36 self.email=email
37 headers=[('Referer','http://'+self.server[self.server.find('.')+1:]+'/register.php')]
38 self.browser = fake_moz(headers)
39 urllib2.install_opener(self.browser)
40 pass
41
42 def ca(self):
43 self.baseurl='http://'+self.server
44 params = {
45 "function":"createAvatar",\
46 "name":self.account,\
47 "email":self.email,\
48 "password":self.password,\
49 "agb":"on"}
50 ret=c(self.baseurl+'/index.php?action=newPlayer').get(params).get_content()
51 pass
52 27
53 class Ikariam: 28 class Ikariam:
54 29
55 cities = {} 30 cities = {}
56 COOKIEFILE = '/tmp/ikariam.lwp' 31 COOKIEFILE = '/tmp/ikariam.lwp'