Node.js 推特机器人返回错误 : Bad Twitter streaming request: 410

标签 node.js twitter npm bots

我运行了这个机器人,它运行了大约 8 个小时,但现在我一运行它就出现以下问题:

events.js:183
  throw er; // Unhandled 'error' event
  ^Error: Bad Twitter streaming request: 410
at Object.exports.makeTwitError (C:\Users\arghya\Documents\Node-JS\Gracias\node_modules\twit\lib\helpers.js:74:13)
at Request.<anonymous> (C:\Users\arghya\Documents\Node-JS\Gracias\node_modules\twit\lib\streaming-api-connection.js:96:29)
at emitOne (events.js:121:20)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (C:\Users\arghya\Documents\Node-JS\Gracias\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

可以引用代码here .

编辑:相同的代码在几个小时后开始工作。我猜这是 API 的超时问题。

最佳答案

您在代码中通过 var stream = twitter.stream('user'); 使用的 API 指的是已弃用的用户流端点。

这将于 8 月 23 日完全删除,但在此日期之前,端点将定期关闭以提醒开发人员他们需要 migrate到替代方法,例如帐户事件 API。您可以阅读有关此停机时间安排的更多信息 here .这就是您看到临时 410 错误的原因。本周它将变得越来越频繁。

关于Node.js 推特机器人返回错误 : Bad Twitter streaming request: 410,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51905999/

相关文章:

python - Tweepy 速率错误

node.js - nodejs 使用 npm + package.json 解析依赖

javascript - 问题在 angular5 中添加第三方(外部)js 库

javascript - 使用缓冲区和流写入数据

node.js - 使用 Node npm 请求进行网页抓取

macos - 在 Path env 中发生更改/错误后 Sudo 将无法工作

twitter - 如何从 TweetSharp 的 ListTweetOnHomeTimeline() 方法获取最多 800 条推文?

swift - 通过 View Controller 中途实现 Twitter 时间轴?

reactjs - 如何知道为我的 React 应用程序安装哪个版本的 Material UI?

node.js - 如何从函数返回fs.lstat方法的结果