Skip to content

Instantly share code, notes, and snippets.

@ShaneRich5
Created June 2, 2017 22:11
Show Gist options
  • Save ShaneRich5/e3a028c0af9cb0077a0ecc7439545340 to your computer and use it in GitHub Desktop.
Save ShaneRich5/e3a028c0af9cb0077a0ecc7439545340 to your computer and use it in GitHub Desktop.
from tweepy import OAuthHandler, Stream
from tweepy.streaming import StreamListener
class Listener(StreamListener):
def on_data(self, data):
print data
return True
def on_error(self, status):
print status
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
twitter_stream = Stream(auth, Listener())
twitter_stream.filter(track=['car'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment