【问题标题】:Retrieving a limited number of direct messages from Twitter从 Twitter 检索有限数量的直接消息
【发布时间】:2011-12-10 15:55:43
【问题描述】:

如何从 Twitter 获得有限数量的直接消息?

Twitter API getDirectMessages() 调用会提供所有消息,但我只想要一个有限的数量。例如,前 50 名。

有什么建议吗?

【问题讨论】:

  • 别问我们怎么用别人的api,问推特。这不是编程问题。
  • @Dan 这里有很多关于使用特定框架和 API 的问题。他们是主题。

标签: android twitter


【解决方案1】:

根据位于https://dev.twitter.com/docs/api/1/get/direct_messages 的 Twitter 文档,directMessages 调用接受一个可选参数 count,该参数确定要返回的直接消息的数量。他们提供了一个示例请求:

GET https://api.twitter.com/1/direct_messages.json?count=1&page=1

【讨论】:

  • visceralG,感谢您的回复,我尝试使用 paging >>Paging paging = new Paging(1,1); // paging(page,count) >>List messages = twitter.getDirectMessages(paging);但它仍然提供所有信息。
  • 宾果游戏,问题解决了。不知道是什么问题,但它使用分页运行完美:)
猜你喜欢
  • 1970-01-01
  • 2020-10-14
  • 1970-01-01
  • 2011-09-17
  • 1970-01-01
  • 1970-01-01
  • 2017-06-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多