User:Natasa Siencnik/project2

From XPUB & Lens-Based wiki
< User:Natasa Siencnik
Revision as of 18:50, 24 January 2011 by Natasa Siencnik (talk | contribs) (Created page with "Category:Prototyping category:2011 P1.02 == Rumor of Revolution == Web crawler searching Twitter for a <i>Revolution</i> <br /> <br /> '''1 - Description''' <br /> '...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Rumor of Revolution

Web crawler searching Twitter for a Revolution

1 - Description


2 - Flowchart

3 - Script

#!//usr/bin/python

import urllib2, json, sys
#from apikey import apikey

#api = twitter.Api(username=username, password=password)
url = 'http://search.twitter.com/search.json?q=%23revolution'
f = urllib2.urlopen(url)
data = json.load(f)
 
for r in data['results']:
#    print r['created_at'] + r['from_user'] + ' : "' + r['text'] + '"'
    sys.stdout.write r['created_at'] + r['from_user'] + ' : "' + r['text'] + '"'


4 - Outcome


5 - Questions

  • parsing