Skip to content

Instantly share code, notes, and snippets.

@jl2
Created July 24, 2010 18:12
Show Gist options
  • Save jl2/488871 to your computer and use it in GitHub Desktop.
Save jl2/488871 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import urllib.request
import xml.dom.minidom
fh = urllib.request.urlopen('http://twitter.com/statuses/user_timeline/jl_2.xml')
doc = xml.dom.minidom.parse(fh)
for stat in doc.getElementsByTagName("status"):
print('Date: {}\nTweet: {}'.format(stat.getElementsByTagName("created_at")[0].firstChild.nodeValue,
stat.getElementsByTagName("text")[0].firstChild.nodeValue))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment