Skip to content

Instantly share code, notes, and snippets.

@DFoly
Created September 25, 2018 16:07
Show Gist options
  • Select an option

  • Save DFoly/a411d3a243bf54b099ccc5d927a2796a to your computer and use it in GitHub Desktop.

Select an option

Save DFoly/a411d3a243bf54b099ccc5d927a2796a to your computer and use it in GitHub Desktop.
main method
if __name__== '__main__':
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api =tweepy.API(auth, wait_on_rate_limit=True)
# create instance of Streamlistener
listener = Streamlistener(api = api)
stream = tweepy.Stream(auth, listener = listener)
track = ['golf', 'masters', 'reed', 'mcilroy', 'woods']
# choose what we want to filter by
stream.filter(track = track, languages = ['en'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment