changeset 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
files pyikriam/ikariam.py
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pyikriam/ikariam.py	Tue Nov 04 16:01:25 2008 +0800
+++ b/pyikriam/ikariam.py	Tue Nov 04 16:27:10 2008 +0800
@@ -25,6 +25,30 @@
         pass
     pass
 
+class CreateAccount:
+    """
+    For create sheep to cheat. take care of the ip address & email check by yourself.
+    """
+    def __init__(self,account,email,password,server):
+        self.account=account
+        self.password=password
+        self.server=server
+        self.email=email
+        headers=[('Referer','http://'+self.server[self.server.find('.')+1:]+'/register.php')]
+        self.browser = fake_moz(headers)
+        urllib2.install_opener(self.browser) 
+        pass
+
+    def ca(self):
+        self.baseurl='http://'+self.server
+        params = {
+        "function":"createAvatar",\
+        "name":self.account,\
+        "email":self.email,\
+        "password":self.password,\
+        "agb":"on"}
+        ret=c(self.baseurl+'/index.php?action=newPlayer').get(params).get_content()
+        pass
 
 class Ikariam: