python - How to make each tweet on its own line? -
i wanting have each tweet on own line.
currently, breaks @ each response (i listed response_1...i using through response_10)
any ideas?
#!/usr/bin/env python import urllib import json response_1 = urllib.urlopen("http://search.twitter.com/search.json?q=microsoft&page=1") in response_1: print (i, "\n")
you have parse json python object first, can iterate on it.
#!/usr/bin/env python import urllib import json response_1 = json.loads(urllib.urlopen("http://search.twitter.com/search.json?q=microsoft&page=1").read()) in response_1['results']: print (i, "\n")
Comments
Post a Comment