【问题标题】:Fetch latest tweet from specific user using twurl使用 twurl 从特定用户获取最新推文
【发布时间】:2021-01-29 17:02:45
【问题描述】:

我正在尝试使用 twurl 从特定帐户获取最新推文,以便可以在命令提示符下完成。我对 Twitter API 不太熟悉,这就是我要问的原因。我不相信有任何方法可以在不获取他们过去 5 天发布的所有推文并将其过滤掉的情况下获取最新推文,但我可能是错的。

【问题讨论】:

  • 最新的推文是用户对象的一部分,所以你应该可以调用/1.1/users/show

标签: api twitter console tweets twurl


【解决方案1】:
  1. 首先,您应该使用消费者 API 和密钥授权您的 twitter 应用和帐户。
  • twurl authorize -consumer-key <key> -consumer-secret <secret>
  1. 然后可以使用GET statuses/user_timeline获取特定用户的最新推文。
  • 按屏幕名称: twurl 1.1/statuses/user_timeline.json?screen_name=noradio&count=1
  • 通过 user_id : twurl 1.1/statuses/user_timeline.json?user_id=12345&count=1

有关请求的更多信息,请参阅twurl

【讨论】:

    猜你喜欢
    • 2014-05-03
    • 2017-02-08
    • 2011-05-08
    • 1970-01-01
    • 1970-01-01
    • 2015-07-07
    • 2021-02-25
    • 1970-01-01
    • 2011-08-10
    相关资源
    最近更新 更多