Created
July 9, 2017 04:23
-
-
Save kdmgs110/f1f0515c106812a6077ff8ecc055111b 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 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