User:Natasa Siencnik/project2: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
(Blanked the page)
 
Line 1: Line 1:
[[Category:Prototyping]]


== Rumor of Revolution ==
Web crawler searching Twitter for a <i>Revolution</i>
<br />
<br />
'''1 - Description''' <br />
'''2 - Flowchart'''<br />
'''3 - Script'''<br />
<source lang="php">
#!//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'] + '"'
</source>
'''4 - Outcome'''<br />
'''5 - Questions'''<br />
* parsing

Latest revision as of 15:55, 8 June 2011