PDA

View Full Version : [Python - Tkinter GUI] ~ avatar grabber



Water
02-10-2016, 04:42 AM
credit DarkByte for NeoAccount.py

Python with functional GUI, will work on all operating systems.
Save the file as XXXX.py
Download Kivy ([Only registered and activated users can see links]). * - only for certain operating systems(Mac, Linux?"
Drag the file onto the Kivy app and it will open as the GUI.


import sys
import Tkinter
import tkMessageBox
from Tkinter import *
import urllib2, urllib, cookielib
import StringIO, gzip

window = Tkinter.Tk()
window.title("clraik Python Daily Doer")
window.geometry('245x85')

class NeoAccount:

d = '[Only registered and activated users can see links]'
headers = [('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1'),
('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),
('Accept-Language', 'en-us,en;q=0.5'),
('Accept-Encoding', 'gzip, deflate')]

def __init__(self, user, pw, proxy = None):
self.user = user
self.pw = pw
self.proxy = proxy
self.referer = ''

cj = cookielib.LWPCookieJar()
cookie_handler = urllib2.[Only registered and activated users can see links](cj)

if proxy != None:
proxy_handler = urllib2.ProxyHandler({'http': '[Only registered and activated users can see links]' + proxy + '/'})
self.opener = urllib2.build_opener(proxy_handler, cookie_handler)
else:
self.opener = urllib2.build_opener(cookie_handler)

def __str__(self):
return '%s:%s' % (self.user, self.pw)

def get(self, url, referer = '', readable = True):
if url[0] == '/':
url = self.d + url
if referer == '':
referer = self.referer
self.opener.addheaders = [('Referer', referer)] + self.headers
res = self.opener.open(url)
self.referer = res.geturl()
if readable:
return self.readable(res)
else:
return res

def post(self, url, data, referer = '', readable = True):
if url[0] == '/':
url = self.d + url
if referer == '':
referer = self.referer
self.opener.addheaders = [('Content-Type', 'application/x-[Only registered and activated users can see links]'),
('Referer', referer)] + self.headers
res = self.opener.open(url, urllib.urlencode(data))
self.referer = res.geturl()
if readable:
return self.readable(res)
else:
return res

def amf(self, packet, gateway = '[Only registered and activated users can see links]', referer = ''):
if referer == '':
referer = self.referer
self.opener.addheaders = [('Content-Type', 'application/x-amf'),
('Referer', referer)] + self.headers
res = self.opener.open(gateway, packet)
return res.read()

def login(self):
res = self.get('/index.phtml')
res = self.post('/login.phtml', {'username': self.user,
'password': self.pw,
'destination': "/index.phtml"}, readable = False)
if 'badpassword' in res.geturl():
return False, 'Bad password'
elif 'hello' in res.geturl():
return False, 'Birthday locked'
elif 'login' in res.geturl():
return False, 'Frozen'
elif 'index' in res.geturl():
return True, 'Logged in'

def readable(self, data):
if 'gzip' in str(data.info()):
return gzip.GzipFile(fileobj=StringIO.StringIO(data.read( ))).read()
else:
return data.read()

#neologin
label3 = Label(window, text="neopets username:").grid(row=0,column=0)
un = Entry(window, bd=5)
un.grid(row=0,column=1)
label4 = Label(window, text="neopets password:").grid(row=1,column=0)
pw = Entry(window, bd=5, show="*")
pw.grid(row=1,column=1)

def getAvatars():
uns = un.get()
pws = pw.get()
acc = NeoAccount(uns, pws)
result = acc.login()
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
html = acc.get("[Only registered and activated users can see links]", "[Only registered and activated users can see links]")
postdata = {"prizecode":"A384J-228P1"}
html = acc.post("[Only registered and activated users can see links]", postdata, "[Only registered and activated users can see links]")
return tkMessageBox.showinfo("Avatar Collector", "All avatars collected")

Button3 = Button(window, text="Start", command=getAvatars).grid(row=3,column=1)


window.mainloop()

Daviid
02-10-2016, 09:04 AM
from Tkinter import * (python 2.7)
from tkinter import * (python 3)

Pointing that out just in case someone uses python 3