Skip to content

Instantly share code, notes, and snippets.

@fmasanori
Last active October 13, 2015 01:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fmasanori/4120037 to your computer and use it in GitHub Desktop.
Save fmasanori/4120037 to your computer and use it in GitHub Desktop.
Python Twitter Client
#
# API DEPRECATED AT JUNE 2013
# https://dev.twitter.com/docs/faq#17750
#
import urllib, json
def busca_tweets(texto='python'):
url = 'http://search.twitter.com/search.json?q=' + texto
resp = urllib.urlopen(url).read()
data = json.loads(resp)
return data['results']
def print_tweets(tweets):
for t in tweets:
print (t['from_user'] + ': ' + t['text'] + '\n')
resultados = busca_tweets('pybr8')
print_tweets(resultados)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment