Created
October 23, 2017 07:45
-
-
Save Yuiki/4024f705b931f5d04a54e9840b22c784 to your computer and use it in GitHub Desktop.
#コンテンツ応用論2017 のTweetを追う
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 | |
# ここらへん入れてね | |
auth = tweepy.OAuthHandler('', '') | |
auth.set_access_token('', '') | |
api = tweepy.API(auth) | |
tag = '#コンテンツ応用論2017' | |
class SearchStreamListener(tweepy.StreamListener): | |
def on_status(self, status): | |
text = status.text.replace(tag, '').replace('\n', '').strip() | |
if len(text) > 1 and not text.isdigit() and not text.startswith('RT @'): | |
print(text) | |
stream = tweepy.Stream(auth=api.auth, listener=SearchStreamListener()) | |
stream.filter(track=[tag], async=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment