Skip to content

Instantly share code, notes, and snippets.

@miya
Last active January 5, 2018 09:03
Show Gist options
  • Save miya/855ab5a147b90f8a132d30137d7b277f to your computer and use it in GitHub Desktop.
Save miya/855ab5a147b90f8a132d30137d7b277f to your computer and use it in GitHub Desktop.
特定の文字列を含むツイートを自動でふぁぼるやつ
import tweepy
def api():
consumer_key = 'consumer_key'
consumer_secret = 'consumer_secret'
access_key = 'access_key'
access_secret = 'access_secret'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
return api
for tweet in api().search('ビットコイン'): #文字列部はふぁぼりたい対象の単語
id = tweet.id
api().create_favorite(id) #ふぁぼります
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment