User:Natasa Siencnik/project2: Difference between revisions

From XPUB & Lens-Based wiki
(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 /> '...")
 
No edit summary
Line 1: Line 1:
[[Category:Prototyping]]
[[Category:Prototyping]]


[[category:2011 P1.02]]


== Rumor of Revolution ==
== Rumor of Revolution ==

Revision as of 17:32, 24 March 2011


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