使用“since_id"时使用 Twitter 搜索 API 的延迟和不一致的结果;范围 [英] Delay and Inconsistent results using Twitter search API when using "since_id" parameter

查看:26
本文介绍了使用“since_id"时使用 Twitter 搜索 API 的延迟和不一致的结果;范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们注意到,在 param 子句中指定了一个 sinid 时,使用 Twitter 搜索 API 似乎会出现延迟和/或不一致的结果.例如:

http://search.twitter.com/search?ors=%23b4esummit+@b4esummit+b4esummit&q=&result_type=recent&rpp=100&show_user=true&since_id=>

将提供最新的推文,但是:

http://search.twitter.com/search?ors=%23b4esummit+@b4esummit+b4esummit&q=&result_type=recent&rpp=100&show_user=true&since_id= 12642940173/p>

通常不会在几个小时内提供该 ID 之后的推文(即使它们在第一个查询中可见)...

有人遇到过类似的问题吗?

解决方案

首先,那些不是 Twitter 搜索 API URL.您应该像这样查询 API:

http://search.twitter.com/search.json?q=%23b4esummit%20OR%20@b4esummit%20OR%20b4esummit&result_type=recent&rpp=100&show_user=true

其次,since_id 从列表底部截断.您可以查看本文档中说明的行为:https://dev.twitter.com/docs/working-with-timelines

例如,在撰写本文时,上述 URL 返回 31 个条目.选择列表中间的推文 ID,我构建了:

http://search.twitter.com/search.json?q=%23b4esummit%20OR%20@b4esummit%20OR%20b4esummit&result_type=recent&rpp=100&rpp_true=true因为_id=178065448397574144

只返回 12 个条目,匹配第一个 URL 的前 12 个条目.

We've noticed what seems to be a delay and/or inconsistent results using the Twitter Search API when specifying a sinceid in the param clause. For example:

http://search.twitter.com/search?ors=%23b4esummit+@b4esummit+b4esummit&q=&result_type=recent&rpp=100&show_user=true&since_id=

Will give the most recent Tweets, but:

http://search.twitter.com/search?ors=%23b4esummit+@b4esummit+b4esummit&q=&result_type=recent&rpp=100&show_user=true&since_id= 12642940173

will often not give tweets that are after that ID for several hours (even though they're visible in the first query)...

anyone have similar problems?

解决方案

First off, those are not Twitter search API URLs. You should be querying the API like this:

http://search.twitter.com/search.json?q=%23b4esummit%20OR%20@b4esummit%20OR%20b4esummit&result_type=recent&rpp=100&show_user=true

Second, since_id cuts off from the bottom of the list. You can see the behavior illustrated in this documentation: https://dev.twitter.com/docs/working-with-timelines

For an example, at the time of this writing, the above URL returns 31 entries. Picking the ID of a Tweet in the middle of that list, I constructed:

http://search.twitter.com/search.json?q=%23b4esummit%20OR%20@b4esummit%20OR%20b4esummit&result_type=recent&rpp=100&show_user=true&since_id=178065448397574144

Which only returns 12 entries, which match the top 12 entries of the first URL.

这篇关于使用“since_id"时使用 Twitter 搜索 API 的延迟和不一致的结果;范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆