Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.78 KB | None | 0 0
  1. import wx
  2. import ast
  3. import urllib2 as url
  4. import hashlib
  5. v=0.1
  6.  
  7. class Chat(wx.Frame):
  8.     def __init__(self, parent, id):
  9.         wx.Frame.__init__(self, parent, id, "ChatMenu", size=(1024, 720))
  10.         self.user=''
  11.         self.updateURL = "http://chatUpdate.yuribot.ml/?v=%s" % v
  12.         self.loginURL="http://chat.yuribot.ml/login?auth=$AUTH&user=$USER&IP=$IP"
  13.         self.registerURL="http://chat.yuribot.ml/register?un=$USER&password=&$PASSWORD&email=$EMAIL"
  14.         self.roomURL="http://chat.yuribot.ml/room?rn=$ROOM&mode=$MODE&msgid=$MSGID$user=$USER$IP=$IP&sort=$SORT&time=$TIMEauth=$AUTH"
  15.         self.createRoom='chat.yuribot.ml/createRoom?rn=$ROOM$owner=$USER$time=$TIMEauth=$AUTH'
  16.         self.roomMods="http://chat.yuribot.ml/room/?rn=$ROOM&m=get&u=$USER&time=$TIME&mode=&MODEauth=$AUTH"
  17.         self.reqIP="http://chat.yuribot.ml/ReqIP"
  18.         self.profileImg='http://pimg.yuribot.ml/%s/%s/%s/img.jpg' % (self.user[0], self.user[1], self.user)
  19.         self.profile='http://profile.yuribot.ml/%s' % (self.user)
  20.         self.edit = 'http://profile.yuribot.ml/edit/a=$AUTH%m=$MINI%f=$FULL&age=$AGE&country=$COUNTRY&city=$CITY'
  21.         self.logout = 'http://chat.yuribot.ml/logout/?auth=$AUTH&ip=$IP
  22.        
  23.    def reqRoomMessages(self, room):
  24.        pass
  25.  
  26.    def reqLogin(self, room, user, password):
  27.        auth = hashlib("%s:%s" % (user, password)).md5()
  28.        login = self.loginURL.replace('$AUTH', auth).replace('$USER', user).replace('$IP', self.getIP())
  29.        result = url.urlopen(login).read()
  30.        if int(login) == 1:
  31.            self.user = user
  32.            return 1
  33.        elif int(login) == 0:
  34.            return 0
  35.    
  36. if __name__=="__main__":
  37.    app = wx.PySimpleApp()
  38.    frame = Chat(parent=None, id=-1)
  39.    frame.Show()
  40.    app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement