Skip to content

Instantly share code, notes, and snippets.

@JourneymanGeek
Last active December 15, 2015 15:39
Show Gist options
  • Save JourneymanGeek/5283618 to your computer and use it in GitHub Desktop.
Save JourneymanGeek/5283618 to your computer and use it in GitHub Desktop.
improved formatting
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