This is a python package that help us to interact with twitter and python in data mining.
import tweepy
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
public_tweets = api.home_timeline()
for tweet in public_tweets:
print(tweet.text)- Go to Twitter For Developers
- Create an app
- After the application has been created go to the
keys and tokenstab. - Under consumer keys you will find ``API_KEY == consumer_key
andAPI_SECRET == consumer_secret` - Authentication Tokens you will find
ACCESS_TOKENandACCESS_TOKEN_SECRET - Then you are ready to go.