Created
April 16, 2018 13:11
-
-
Save MKagesawa/67f24c1cbcc95f92a5cd0ff2deefb9e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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