Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#コンテンツ応用論2017 のTweetを追う
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