【问题标题】:Query problems with Twitter search APITwitter 搜索 API 的查询问题
【发布时间】:2016-01-18 08:22:32
【问题描述】:

我正在根据他们的指令 here 和 here 构建 Twitter 搜索 API 查询。

如果我使用上述说明的确切示例,查询工作正常,例如如果我发送这样的查询:q=%23superbowl&result_type=recent,它会给我尽可能多的答案

但是

如果我尝试搜索主题标签 jäniksenvuosi(我知道它会被多次推文),我只会得到一个答案,而该答案是我自己最新的推文。没有别的了。

我也尝试过使用其他带有变音符号的芬兰语单词,但这些都可以正常工作,因此也与变音符号无关。

简短的问题

这两者有什么区别,我该如何解决?

  • 工作: q=%23superbowl&result_type=recent
  • 不工作: q=%23j%C3%A4niksenvuosi&result_type=recent

搜索元数据

超级碗:

[search_metadata] => Array
    (
        [completed_in] => 0.075
        [max_id] => 688984569614327808
        [max_id_str] => 688984569614327808
        [next_results] => ?max_id=688976241051873280&q=%23superbowl&count=30&include_entities=1&result_type=recent
        [query] => %23superbowl
        [refresh_url] => ?since_id=688984569614327808&q=%23superbowl&result_type=recent&include_entities=1
        [count] => 30
        [since_id] => 0
        [since_id_str] => 0
)

jäniksenvuosi

[search_metadata] => Array
    (
        [completed_in] => 0.052
        [max_id] => 688984569614327808
        [max_id_str] => 688984569614327808
        [query] => %23j%C3%A4niksenvuosi
        [refresh_url] => ?since_id=688984569614327808&q=%23j%C3%A4niksenvuosi&result_type=recent&include_entities=1
        [count] => 30
        [since_id] => 0
        [since_id_str] => 0
    )

【问题讨论】:

    标签: api twitter twitter-search


    【解决方案1】:

    刚刚使用 twurl 进行了尝试,目前我得到了该主题标签 (#jäniksenvuosi) 的三个结果。

    这与我的预期一致。在 Twitter 网站上,1 月份返回了三条包含该主题标签的推文。上一次发生在 12 月。

    Twitter 的搜索 API 可以访问大约 7 天的推文索引,它针对新近度而非完整性进行了优化(请参阅 this page in the developer documentation)

    【讨论】:

    • 正是我正在寻找的那种答案!我一定错过了 7 天的限制。我只需要为我的目的制作一个更复杂的 API 请求逻辑,并使用不同的端点......可能我必须让它通过我的时间线。谢谢!
    猜你喜欢
    • 2014-07-09
    • 1970-01-01
    • 2012-11-30
    • 2013-07-24
    • 2014-04-23
    • 2013-05-24
    • 1970-01-01
    • 1970-01-01
    • 2021-02-06
    相关资源
    最近更新 更多