Guest User

Untitled

a guest
Apr 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import tweepy
  2. from textblob import TextBlob
  3.  
  4. consumer_key = ''
  5. consumer_secret = ''
  6.  
  7. access_token = ''
  8. access_token_secret = ''
  9.  
  10. auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
  11. auth.set_access_token(access_token, access_token_secret)
  12.  
  13. api = tweepy.API(auth)
  14.  
  15. public_tweets = api.search('bitcoin')
  16.  
  17. for tweet in public_tweets:
  18. print(tweet.text)
  19. analysis = TextBlob(tweet.text)
  20. print(analysis.sentiment)
Add Comment
Please, Sign In to add comment