开发者

Count the number of pages returned by twitter search API

开发者 https://www.devze.com 2023-03-07 08:22 出处:网络
Is there a way to count the number of page开发者_JAVA技巧s returned by the twitter search API? I\'m just trying to get an idea if there\'s a way to access how many pages there are for a specific query

Is there a way to count the number of page开发者_JAVA技巧s returned by the twitter search API? I'm just trying to get an idea if there's a way to access how many pages there are for a specific query.


As I understand, there is no way to get "total number of pages", or total number of records, for a twitter query. If you look at twitters interface, or anything that uses twitter, they don't have any number of pages represented. What you should do instead, is to have a "load more tweets" option that goes to the next page, instead of having a "page 1 of 10".

That kind of paging is by many considered obsolete anyways :)


The twitter search API says this:

The API also supports the following optional URL parameters:

... rpp: the number of tweets to return per page, up to a max of 100. E.g., http://search.twitter.com/search.atom?lang=en&q=devo&rpp=15

page: the page number to return, up to a max of roughly 1500 results (based on rpp * page) ...

so yeah, there is a way, but that depends on how many tweets per page you want to get.

0

精彩评论

暂无评论...
验证码 换一张
取 消