Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #imports
- from xml.dom import minidom
- import urllib
- #taking care of the username stuff.
- username = raw_input("chatango username: ")
- first_char = username[:1]
- sec_char = username[1:2]
- mini = 'http://st.chatango.com/profileimg/'+first_char+'/'+sec_char+'/'+username+'/mod1.xml'
- full = 'http://st.chatango.com/profileimg/'+first_char+'/'+sec_char+'/'+username+'/mod2.xml'
- #stuff for the mini profile
- url_str = mini
- xml_str = urllib.urlopen(url_str).read()
- xmldoc = minidom.parseString(xml_str)
- profile = xmldoc.getElementsByTagName('body')
- body = profile[0].firstChild.nodeValue
- print '### Mini Profile ###\n'
- mini = urllib.unquote(body)
- print mini.encode('UTF-8') #this prints it out.
- #stuff for the full profile
- url_str = full
- xml_str = urllib.urlopen(url_str).read()
- xmldoc = minidom.parseString(xml_str)
- profile = xmldoc.getElementsByTagName('body')
- body = profile[0].firstChild.nodeValue
- print '\n### Full Profile ###\n'
- full = urllib.unquote(body)
- print full.encode('UTF-8') #this prints it out.
- input() #stop the program so the user can read the contents, else press enter to end!
Advertisement
Add Comment
Please, Sign In to add comment