Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MKagesawa/67f24c1cbcc95f92a5cd0ff2deefb9e7 to your computer and use it in GitHub Desktop.
Save MKagesawa/67f24c1cbcc95f92a5cd0ff2deefb9e7 to your computer and use it in GitHub Desktop.
import tweepy
from textblob import TextBlob
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
public_tweets = api.search('bitcoin')
for tweet in public_tweets:
print(tweet.text)
analysis = TextBlob(tweet.text)
print(analysis.sentiment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment