Guest User

Untitled

a guest
Oct 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. import tweepy
  2. from tweepy import OAuthHandler
  3. from tweepy.streaming import StreamListener
  4.  
  5. access_token = "minhas credenciais da API para devs do TT"
  6. access_secret="minhas credenciais da API para devs do TT"
  7. consumer_key="minhas credenciais da API para devs do TT"
  8. consumer_secret="minhas credenciais da API para devs do TT"
  9.  
  10.  
  11. auth = OAuthHandler(consumer_key, consumer_secret)
  12. auth.set_access_token(access_token, access_secret)
  13.  
  14. api = tweepy.API(auth)
  15.  
  16. # The Twitter user who we want to get tweets from
  17. name = "skyresponde"
  18. # Number of tweets to pull
  19. tweetCount = 5
  20.  
  21. # Calling the user_timeline function with our parameters
  22. results = api.user_timeline(id=name, count=tweetCount)
  23.  
  24. # foreach through all tweets pulled
  25. for tweet in results:
  26. # printing the text stored inside the tweet object
  27. print(tweet.text)
Add Comment
Please, Sign In to add comment