python - 使用 python-twitter 从用户获取所有推文

标签 python twitter

我正在尝试使用此 lib 从 python 中的用户检索所有推文.

python-twitter 中提供的方法定义为:

def GetUserTimeline(self,
user_id=None,
screen_name=None,
since_id=None,
max_id=None,
count=None,
include_rts=None,
trim_user=None,
exclude_replies=None):

如果计数限制为 200。

文档:

count: Specifies the number of statuses to retrieve. May not be greater than 200. [Optional]

我现在的问题是:是否可以使用此库检索用户的所有推文?还有其他解决方案吗?

最佳答案

简短的回答:没有。

Twitter API 明确表示您不能每次请求从用户那里检索超过 200 条推文,因此这不是您正在使用的这个特定库的限制,而是 Twitter 强加的限制。但请记住,这是针对每个请求的,如果您将发送多个请求,您可以获得总共最多 3200 条推文。但这仍然意味着您无法获取所有推文,只能获取 3200 条。

Here is official Twitter API statuses/user_timeline endpoint documentation.

关于python - 使用 python-twitter 从用户获取所有推文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17739716/

相关文章:

python - fbs 和 PyQt5 中的应用程序名称显示为未知

Python - 通过移动极差求和所有值

python - 无法从 Python 连接到在 Azure Linux VM 上运行的 Redis 实例

python - 提取 Twitter 帐户描述 抓取

python - 如何使用 Google Cloud NL api 进行情绪分析?

python - 正则表达式匹配中 [ab] 和 (a|b) 的区别?

python - 基于 mixin 列表的交叉以编程方式定义 python 类的好方法?

ios - Twitter 与 iOS 中的解析集成出现错误 1012

c# - 在流式传输 Web 请求时使用 StreamReader 流 .NET?

ios - Twitter/Fabric 登录按钮只能工作一次