python - 为什么我在使用 Twitter Rest API 时收到此错误

标签 python api twitter oauth machine-learning

这是我在这里发表的第一篇文章,所以如果我的问题很奇怪/愚蠢,我很抱歉。

我正在使用这本书 -> Building Machine Learning Systems with Python 来学习。

在第 6 章中,我们必须下载 Niek Sanders 的推文语料库(约 5000 条推文),我在作者 github 上找到了在线代码 --> here 并使用我的 Twitter 应用程序帐户并在 twitter auth.py 文件中输入所有 key 和 token 。但是,当我运行 install.py 文件时,它会下载 5 条推文并向我输出以下错误:

We will skip 1107 tweets that are not available or visible any more on twitter
We have already downloaded 5 tweets.
Fetching 4779 tweets...
['apple', 'positive', '126394830791254016']
--> downloading tweet #126394830791254016 (1 of 4779)
Twitter sent status 404 for URL: 1.1/statuses/show.json using parameters: (id=blank&oauth_consumer_key=blank&oauth_nonce=blank&oauth_signature_method=blank&oauth_timestamp=1424721838&oauth_token=blank&oauth_version=1.0&oauth_signature=blank)
details: {"errors":[{"code":144,"message":"No status found with that ID."}]}

我在这里用单词空白替换了所有 key 以保密

最佳答案

从外观上看,您似乎正在尝试提取 ID 无效的推文。该推文很可能已被删除,从而使 ID 无效。

关于python - 为什么我在使用 Twitter Rest API 时收到此错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28682599/

相关文章:

api - 如何调试音频节点连接?

java - 从 Twitter hbc API 获取推文

python - Matplotlib 动画无法正确保存

python - RabbitMQ 在处理长时间运行的任务和超时设置产生错误时关闭连接

php - LinkedIn Rich Media 共享 API 错误 'Not enough permissions to access media resource'

c++ - 创建 Windows 应用程序的最佳方式

oauth - Twitter oauth 跳过现有用户的允许连接屏幕

ios - Sharekit2.0 : how can I directly share to facebook and twitter, 而不是通过 UIActionSheet?

python - 最小化计算时间(即 : "print" slows it down)

python - 为什么 `eval` 在 Python 类函数中不起作用?