Return to Snippet

Revision: 27755
at June 22, 2010 14:23 by heellxz


Initial Code
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()

Initial URL

                                

Initial Description
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.

Initial Title
Habbo Badge Finder

Initial Tags

                                

Initial Language
Python