comparison pyikriam/ikariam.py @ 219:7107c26ba197

Add class CreateAccount. this class is not finsh yet.
author kevin@localhost.localdomain
date Tue, 04 Nov 2008 16:27:10 +0800
parents 785c89e5db32
children 5fa938cbe058
comparison
equal deleted inserted replaced
218:785c89e5db32 219:7107c26ba197
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 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
28 52
29 class Ikariam: 53 class Ikariam:
30 54
31 cities = {} 55 cities = {}
32 COOKIEFILE = '/tmp/ikariam.lwp' 56 COOKIEFILE = '/tmp/ikariam.lwp'