【发布时间】:2017-04-12 13:03:18
【问题描述】:
我想收藏尚未发布的用户推文。同样,我写了以下内容:
try:
tweets = api.user_timeline(screen_name = handleSubmit,count=retweetCount)
for tweet in tweets:
if not tweet.favorited:
print tweet
api.create_favorite(tweet.id)
if not tweet.retweeted:
api.retweet(tweet.id)
except Exception as e:
raise e
但是,在某些情况下tweet.favorited 会返回 false,即使已经收藏了推文,也会导致以下错误:
[{u'message': u'You have already favorited this status.', u'code': 139}]
我在这里做错了什么?
【问题讨论】:
标签: python django twitter tweepy