Total Page Number

0 views
Skip to first unread message

Joanna

unread,
Aug 23, 2010, 10:29:43 PM8/23/10
to collecta developer
Hello,

I'm working on Collecta's HTTP API right now and was wondering if
there was a way to get the number of pages for all the results? I'd
also like to get all the results for a specific search. Is there a
way to do that using HTTP API? Or do I need to call on the URL again
to get the next set of results?

Any thoughts and ideas would be much appreciated.

Christopher Zorn

unread,
Aug 24, 2010, 8:54:29 AM8/24/10
to collecta-...@googlegroups.com
It should be in the <opensearch:totalResults> element. 

Joanna

unread,
Aug 25, 2010, 12:21:58 AM8/25/10
to collecta developer
Hi Christopher,

Thanks for the reply.

I looked into the <opensearch:totalResults> element and it says 100
too, the same as the <opensearch:itemsPerPage> element.
So does it mean that there are only 100 results for the entire search
dating way way back?

On Aug 24, 8:54 pm, Christopher Zorn <christopher.z...@gmail.com>
wrote:
> It should be in the <opensearch:totalResults> element.
>
Message has been deleted

Joanna

unread,
Aug 25, 2010, 5:15:54 AM8/25/10
to collecta developer
Oh, my mistake. I saw the correct <opensearch:totalResults>
containing the total # of results for the search.
But my problem now is, how to retrieve all the results in ATOM format.
I'm thinking of retrieving a link in the header of the ATOM format.
It's something like this:
<link type="application/atom+xml" rel="next" href="http://
api.collecta.com/search?page=2&amp;q=&quot;katy%20perry&quot;%20-
category:photo%20-category:video%20language:en" />
Am I correct that this leads to the next set of results?

:)

Christopher Zorn

unread,
Aug 25, 2010, 8:27:07 AM8/25/10
to collecta-...@googlegroups.com
On Wed, Aug 25, 2010 at 5:15 AM, Joanna <joanna.ti...@gmail.com> wrote:
Oh, my mistake.  I saw the correct <opensearch:totalResults>
containing the total # of results for the search.
But my problem now is, how to retrieve all the results in ATOM format.
I'm thinking of retrieving a link in the header of the ATOM format.
It's something like this:
<link type="application/atom+xml" rel="next" href="http://
api.collecta.com/search?page=2&amp;q=&quot;katy%20perry&quot;%20-
category:photo%20-category:video%20language:en
" />
Am I correct that this leads to the next set of results?

:)


It does but results are ordered by time. So you may get a different set of results when using 'page'. If you want to page through results the best thing to do is to use the 'after_id' or 'since_id' parameters.


 You should see a <link rel='after'/> element in the data returned too. 

Hope this helps. 
Reply all
Reply to author
Forward
0 new messages