Skip to content

Instantly share code, notes, and snippets.

@michaelhelmick
Created May 28, 2013 18:00
Show Gist options
  • Save michaelhelmick/5664714 to your computer and use it in GitHub Desktop.
Save michaelhelmick/5664714 to your computer and use it in GitHub Desktop.
import requests
from requests_oauthlib import OAuth1
import json
auth = OAuth1(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
client = requests.Session()
client.auth = auth
client.stream = True
response = client.post('https://stream.twitter.com/1.1/statuses/filter.json', data={'track': '@mikehelmick'})
for line in response.iter_lines():
if line:
print json.loads(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment