Skip to content

Instantly share code, notes, and snippets.

@simonjcarr
Last active August 17, 2020 14:10
Show Gist options
  • Select an option

  • Save simonjcarr/de8927dbfb42ae6aa48d30ed04e8e4c3 to your computer and use it in GitHub Desktop.

Select an option

Save simonjcarr/de8927dbfb42ae6aa48d30ed04e8e4c3 to your computer and use it in GitHub Desktop.
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