Hello,

I would like to have my script log in to a vBulletin forum. My script does
seem to do this (as I can check my control panel, etc.). But although I can
get access to my account, the forum fails to update the date when I last
visited. That date updates just fine when I do it manually through a
browser. I was wondering if I was maybe messing something up with cookies.
Any suggestions would be appreciated. Thanks!

#!/usr/bin/python
# forumlogin.py
#         Logs into vBulletin forum

import urllib2, time
import cgitb; cgitb.enable()

def main():
     print "Content-type: text/html\n"

     url = "http://forums.x10hosting.com/login.php?do=login";
     queryString = "..."

     opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
     response = opener.open(url, queryString)
     logfile()
     response.close()

def logfile():
     fileIn = open("../logfile.txt", "a")
     fileIn.write("\n")
     fileIn.write(time.ctime())
     fileIn.close()

*if* __name__ == "__main__":
     main()
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to