Created
July 13, 2011 20:04
-
-
Save rochacbruno/1081197 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################## | |
# TWITTER IMAGE | |
######################################################################## | |
def get_twitter_image(username): | |
from urllib2 import urlopen | |
from xml.dom.minidom import parse as domparse | |
apiurl = 'http://twitter.com/users/show/%s' | |
dom = domparse(urlopen(apiurl % username)) | |
twitter_image = '' | |
for node in dom.getElementsByTagName('profile_image_url'): | |
#profile_image_url | |
twitter_image = node._get_lastChild() | |
return twitter_image.nodeValue | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment