【问题标题】:Twitter4J android query search does not return all tweetsTwitter4J android 查询搜索不返回所有推文
【发布时间】:2014-07-10 22:16:01
【问题描述】:

我正在使用 Twitter4J 库开发 Twitter Android 应用程序。流 API 工作正常。但是搜索 API 并没有返回所有推文,中间的一些推文被跳过并且在搜索结果中找不到。

我正在使用 query("from:handle") 进行查询,我检查了相应句柄的 Twitter 页面,并非页面上的所有推文都出现在搜索结果中。大多数带有图片的推文都被遗漏了。

下面是我正在使用的代码。

    String handle = "ndtv";
    Query query = new Query("from:"+handle);
    query.setCount(100); // Limit of resultset
    QueryResult result = twitter.search(query);
    System.out.println("Count : " + result.getTweets().size()) ;
    for (Tweet tweet : result.getTweets()) {
        System.out.println("text : " + tweet.getText());
    }

有人在 twitter4j 上遇到过类似的问题吗?或者 twitter 搜索 API 有什么限制?

【问题讨论】:

    标签: android twitter twitter4j


    【解决方案1】:

    来自here

    重要的是要知道搜索 API 关注的是相关性而不是完整性。这意味着搜索结果中可能会丢失一些推文和用户。如果您想匹配完整性,您应该考虑改用Streaming API

    【讨论】:

      猜你喜欢
      • 2019-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-10
      • 2021-12-20
      • 1970-01-01
      • 1970-01-01
      • 2018-09-01
      相关资源
      最近更新 更多