【问题标题】:Retrieve live tweets from Twitter API从 Twitter API 检索实时推文
【发布时间】:2018-08-23 23:29:50
【问题描述】:

我正在尝试从 Twitter 用户中提取选定用户的实时推文。 'statuses/user_timeline.json' API 端点检索用户的所有推文,但我不想只过滤当前处于活动状态的推文。

那么有没有办法只检索特定推特用户的实时推文?

【问题讨论】:

    标签: node.js twitter sttwitterapi


    【解决方案1】:

    是的。首先,使用statuses/user_timeline 获取来自该用户的最新推文,并保存推文的id。然后,在不超过速率限制的某个时间间隔内,再次请求 statuses/user_timeine,但将 since_id 参数设置为您保存的 id

    这是 Twitter 的文档:https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-11
      • 2012-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-10
      • 1970-01-01
      • 2016-12-19
      相关资源
      最近更新 更多