Quantcast

Jump to content


Photo

[Python] Neopets prog source code


  • Please log in to reply
2 replies to this topic

#1 huevoquilmes

huevoquilmes
  • 245 posts

Posted 14 February 2010 - 03:07 PM

Hi guys. I was wondering, is there any source code of a neo program made in python? i really want to learn to make one, but dont have any example to follow (and the search function doesnt work).

Any help is welcome... if someone is willing to help me through it via msn is AWESOME (already know C,C++,PHP and a couple more).

#2 Adam

Adam
  • Coffee God


  • 4771 posts


Users Awards

Posted 14 February 2010 - 03:24 PM

import urllib
import urllib2
import cookielib

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)")]

url = "http://www.neopets.c...om/login.phtml"
request = urllib2.Request(url, "username=usernamehere&password=passwordhere")
page = opener.open(request)
contents = page.read()

if "logout" in contents:
print "logged in"

raw_input("checking finished: ")



Credits to jimmy legend

That's a pretty simple neopets login. I'm not sure the programmers will share with you much more then that.

#3 huevoquilmes

huevoquilmes
  • 245 posts

Posted 14 February 2010 - 03:57 PM

tyvm adam... ill start with that.. helps a lot... Any other imput is welcome Posted Image

Edited by huevoquilmes, 14 February 2010 - 03:57 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users