Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help with my python code?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
jamoaka007
Master Cheater
Reputation: 0

Joined: 26 Feb 2008
Posts: 388

PostPosted: Fri Jan 30, 2009 10:11 am    Post subject: Help with my python code? Reply with quote

I'm making a gaia autoposter but there's a problem it keeps saying Capatcha up.

Can anybody help?

Code:
import time
import urllib
import urllib2
import cookielib
import re
import random
import sys, linecache
from time import mktime, strftime, strptime, gmtime

cookieJar = cookielib.LWPCookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookieJar))
opener.addheaders = [('User-agent', "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty)")]

username = raw_input("username: ")
password = raw_input("password: ")



form = { "username" : username,
         "password" : password }

encodedForm = urllib.urlencode(form)
url = "http://login.gaiaonline.com/gaia/login.php"
request = urllib2.Request(url, encodedForm)
page = opener.open(request)
contents = page.read()

sessionID = cookieJar._cookies[".gaiaonline.com"]["/"]["gaia55_sid"].value

if len(sessionID) < 32:
    print "No valid session"
    raw_input("\nPress ENTER to exit...")
    sys.exit()
   
print "Your session ID is:", sessionID

for i in xrange(10):
    Url = "http://www.gaiaonline.com/forum/chatterbox/mpt-let-s-get-this-thread-to-a-million-pages-original/t.1488895/"
    form = { "action" : "issue",
         "submit_action" : "Post+Reply" }

    encodedForm = urllib.urlencode(form)
    request = urllib2.Request(url, encodedForm)
    page = opener.open(request)
    contents = page.read()
   
message = "bump"

form = { "message" : message}

Form = { "action" : "issue",
         "submit_action" : "Post+Reply" }

encodedForm = urllib.urlencode(form)
request = urllib2.Request(url, encodedForm)
page = opener.open(request)
contents = page.read()

findExpression = re.compile(".*You got (.*) gold for posting in the forums.*")
matches = re.findall(findExpression, contents)

if len(matches) > 0:
        gold = matches[0]
        print "You got", gold, "gold!"
else:
        print "The capatcha is up"
   

strTime = random.randrange(80,120)
time.sleep(strTime)






_________________
There's a reputation button for a reason USE IT.

Gaia Black market
http://www.gaiablackmarket.com/index.php

Respected List:
Raredaredevil
ToxicRaiin
thegaiacheater

Asshole list
S3NSA
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites