如何解决Tweepy 转发了两次
我正在检查最后一条推文,然后使用该推文 ID 转发,唯一的问题是它转发了两次 以下是我的代码:
import tweepy
import tkinter
auth = tweepy.OAuthHandler('abcdefghijklmnopqrstuvwxyz','abcdefghijklmnopqrstuvwxyz')
auth.set_access_token('abcdefghijklmnopqrstuvwxyz','abcdefghijklmnopqrstuvwxyz')
api = tweepy.API(auth,wait_on_rate_limit=True,wait_on_rate_limit_notify=True)
# set parser=tweepy.parsers.JSONParser() if you want a nice printed json response.
user = api.me()
tweets = api.user_timeline(user.screen_name,# 200 is the maximum allowed count
count=1,include_rts = False,# Necessary to keep full_text
# otherwise only the first 140 words are extracted
tweet_mode = 'extended'
)
for info in tweets[:3]:
print("ID: {}".format(info.id))
print(info.created_at)
print(info.full_text)
print("\n")
api.retweet(info.id)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。