Last active
December 15, 2015 15:39
-
-
Save JourneymanGeek/5283618 to your computer and use it in GitHub Desktop.
improved formatting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def searchTweets(query): | |
search = requests.get("http://search.twitter.com/search.json?q="+query) | |
dict = search.json() | |
for result in dict["results"]: # result is a list of dictionaries | |
print ("*",result["text"],"\n") | |
#inspired by on http://glowingpython.blogspot.de/2011/04/how-to-use-twitter-search-api.html, rewritten in python 3 and using requests by Ravi Mohan, The Journeyman Geek |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment