Skip to content

Instantly share code, notes, and snippets.

@kdmgs110
Created July 9, 2017 04:23
Show Gist options
  • Save kdmgs110/f1f0515c106812a6077ff8ecc055111b to your computer and use it in GitHub Desktop.
Save kdmgs110/f1f0515c106812a6077ff8ecc055111b to your computer and use it in GitHub Desktop.
import oauth
api = oauth.api
#自分のタイムラインのツイートを取得
tweets = api.home_timeline(count = 30,include_rts = False)
#自分のタイムラインのツイートを30個取り出して、いいねする
for tweet in tweets:
try:
tweetid = tweet.id
tweetauthor = tweet.user.name
tweetcontent = tweet.text
print('ユーザー名:')
print(tweetauthor)
print("コンテンツ")
print(tweetcontent)
api.create_favorite(tweetid) #ファヴォる
print("ツイートをふぁぼしました。")
except:
print("すでにふぁぼが完了しています。")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment