/ Published in: Python
Un buscador de placas por usuario, ingresas el nickname y el hotel en donde esta registrado el usuario y guarda en un log de texto todas las placas que el usuario tiene.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import urllib2 ############################ ############################ #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ############ #### #### #### #### #### #### #### #### ############################ ############################ print "Badge Finder Por Cesar Vasquez C (AKA Heellxz).\n" nick = raw_input(">>Nickname: ") hotel = raw_input(">>Hotel (Ej: es, com, etc): ") xa = urllib2.urlopen("http://www.habbo." + hotel + "/habblet/ajax/new_habboid?habboIdName=" + nick) xb = xa.read() id1 = xb[xb.find("<em>")+4:xb.find("</em>")] id = id1.replace(" ", "") fin = "" a = urllib2.urlopen("http://www.habbo." + hotel + "/myhabbo/badgelist/badgepaging?pageNumber=1&widgetId=10807795&_mypage.requested.account=" + id) b = a.read() if b.find("badgeListTotalPages") > 0: x = b[b.find('type="hidden" id="badgeListTotalPages" value="')+46:b.find('type="hidden" id="badgeListTotalPages" value="')+48] pagz = x.replace('"', '') else: pagz = 1 for j in range(1, int(pagz) + 1): a = urllib2.urlopen("http://www.habbo." + hotel + "/myhabbo/badgelist/badgepaging?pageNumber=" + str(j) + "&widgetId=10807795&_mypage.requested.account=" + id) b = a.read() aux = b[b.find('<ul class="clearfix">'):b.find('<div id="footer">')] spl = aux.split() for i in spl: if i.find("url(") == 0: placa = i[i.find("url(http://images.habbo.com/c_images/album1584/")+47:i.find('.gif)"></li>')] fin = fin + placa + "\n" print "Trabajando..." f = open("Placas_log_" + nick + ".txt", "w") f.write(fin) f.close()