Last active
August 17, 2020 14:10
-
-
Save simonjcarr/de8927dbfb42ae6aa48d30ed04e8e4c3 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
| import tweepy | |
| from dotenv import load_dotenv | |
| import os | |
| load_dotenv() | |
| auth = tweepy.OAuthHandler(os.getenv("API_KEY"), os.getenv("API_SECRET_KEY")) | |
| auth.set_access_token(os.getenv("ACCESS_TOKEN"), | |
| os.getenv("ACCESS_TOKEN_SECRET")) | |
| api = tweepy.API(auth) | |
| class TwitterListener(tweepy.StreamListener): | |
| def on_status(self, status): | |
| print(status.text) | |
| twitterListener = TwitterListener() | |
| myStream = tweepy.Stream(auth=api.auth, listener=twitterListener) | |
| myStream.filter(track=['javascript', 'nodejs', 'python']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment