Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Pagination #225

Closed
codingmusician opened this issue Dec 10, 2016 · 3 comments
Closed

Pagination #225

codingmusician opened this issue Dec 10, 2016 · 3 comments

Comments

@codingmusician
Copy link

Is there a way to request different pages? I know we can set a limit for searches and other things, but it'd be nice to set a limit and page. We'd like to be able to get the first 100 results, then the 2nd 100 results is a separate call. Is there any way to do that currently? If not, are there plans to add this in?

@seregazhuk
Copy link
Owner

The problem is that Pinterest doesn't provide pagination. With every request it returns bookmarks - an offset string to get the next batch of the results. There is no way to get the second batch, without going through the first one.
I think I can implement something like this:

$results = $bot->pins->search('query', 100)->skip(100)->get();

But behind the scenes, a bot will go through the first 100 results.

@seregazhuk
Copy link
Owner

@codingmusician, done! In version 5.1.2 you can use pagination as I mentioned above:

// to skip first 100 results
$results = $bot->pins->search('query', 100)->skip(100)->get();

@codingmusician
Copy link
Author

Awesome! Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants