2016-07-24 42 views
0

我發現這個代碼如何使用Tweepy回覆特定用戶最近的推文?

toReply = "xxx" 
api = tweepy.API(auth) 



tweets = api.user_timeline(screen_name = toReply, count=1) 

for tweet in tweets: 
api.update_status("@" + toReply + " my reply", in_reply_to_status_id = tweet.id) 

但是這不是我要找的。它只是回覆最新的推文。我希望bot每次都會回覆xxx推文。我應該在我的代碼中更改什麼?

回答

2
while True: 
    for tweet in api.user_timeline(...):