Created
June 2, 2017 22:11
-
-
Save ShaneRich5/e3a028c0af9cb0077a0ecc7439545340 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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