User:Mirjam Dissel/JSON twitter API in Python
< User:Mirjam Dissel
Revision as of 13:48, 21 January 2011 by Mirjam Dissel (talk | contribs) (Created page with "Friday 21 Jan 2011 ---- Chmod it by removing extension and in terminal:<br> chmod +x filename execute by typing in terminal:<br> filename searchquery <source lang="python">...")
Friday 21 Jan 2011
Chmod it by removing extension and in terminal:
chmod +x filename
execute by typing in terminal:
filename searchquery
#!/usr/bin/python
import sys, json, urllib2, os
f = urllib2.urlopen("http://search.twitter.com/search.json?q="+sys.argv[1])
data = json.load(f)
for r in data ["results"]:
print r["text"]