Skip to content

Instantly share code, notes, and snippets.

@edsu
Created September 26, 2011 19:17
Show Gist options
  • Select an option

  • Save edsu/1243098 to your computer and use it in GitHub Desktop.

Select an option

Save edsu/1243098 to your computer and use it in GitHub Desktop.
microdata experiment
>>> import microdata
>>> import urllib
>>> html = urllib.urlopen('http://lx6.loc.gov').read()
>>> items = microdata.get_items(html)
>>> print len(items)
30
>>> print items[0].tweet_time
2011-02-15 06:00
>>> print items[0].json()
{
"status": [
"fetching"
],
"updated": [
"2011-09-26 15:15:34"
],
"unpack_time": [
""
],
"fetch_time": [
""
],
"num_deletes": [
""
],
"$itemid": "/api/v1/bag/1572",
"tweet_time": [
"2011-02-15 06:00"
],
"$itemtype": "http://twitter.loc.gov/#bag",
"num_tweets": [
""
],
"analysis_time": [
""
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment