Python Tweepy转发两次
我正在检查最后一条推文,然后使用该推文Id转发。唯一的问题是,它转发了两次,下面是我的代码:Python Tweepy转发两次,python,twitter,tweepy,Python,Twitter,Tweepy,我正在检查最后一条推文,然后使用该推文Id转发。唯一的问题是,它转发了两次,下面是我的代码: import tweepy import tkinter auth = tweepy.OAuthHandler('abcdefghijklmnopqrstuvwxyz','abcdefghijklmnopqrstuvwxyz') auth.set_access_token('abcdefghijklmnopqrstuvwxyz','abcdefghijklmnopqrstuvwxyz') api =
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)