Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tweepy
- from tweepy import OAuthHandler
- from tweepy.streaming import StreamListener
- access_token = "minhas credenciais da API para devs do TT"
- access_secret="minhas credenciais da API para devs do TT"
- consumer_key="minhas credenciais da API para devs do TT"
- consumer_secret="minhas credenciais da API para devs do TT"
- auth = OAuthHandler(consumer_key, consumer_secret)
- auth.set_access_token(access_token, access_secret)
- api = tweepy.API(auth)
- # The Twitter user who we want to get tweets from
- name = "skyresponde"
- # Number of tweets to pull
- tweetCount = 5
- # Calling the user_timeline function with our parameters
- results = api.user_timeline(id=name, count=tweetCount)
- # foreach through all tweets pulled
- for tweet in results:
- # printing the text stored inside the tweet object
- print(tweet.text)
Add Comment
Please, Sign In to add comment