如何转发某个账号的最新推文?

How to Retweet the latest Tweet of a certain account?

我需要能够从某个 Twitter 帐户转推最新的推文,但在自动获取最新 post 的推文 ID 时遇到问题。例如,我使用了 api.retweet() 函数,但我需要知道在这个函数中输入什么,以及如何从最新的推文中提取 ID。 这是使用 Tweepy 模块(Python Twitter 模块)。

您可以使用 API.user_timeline to retrieve their latest Tweet and the id attribute of that Status/Tweet object 代表他们最近的推文。