macuenca / Instagram-PHP-API

A PHP implementation of the official Instagram API
182 stars 60 forks source link

Pagination with definable variables #11

Closed askchrisedwards closed 11 years ago

askchrisedwards commented 11 years ago

I was looking for a simple way to exercise pagination parameters easily.

I can see how endpoints could or "would" be used but I am also unsure of how to implement on the frontend to allow a user to easily page through their entire UserFeed after login.

macuenca commented 11 years ago

You can do pagination for a user's media using the getUserRecent() method and passing the delimiting media id's or the timestamps range. There's no easy way that I know of retrieving the whole user's media in advance though, but you can take a look at the endpoints on http://instagram.com/developer/endpoints/users/

askchrisedwards commented 11 years ago

I think calling it isn't an issue as I found those endpoints useful it was the implementation I am stumped on to paginate in your example you have. I am not sure what to put where so it doesn't break basically to page it,

macuenca commented 11 years ago

If I understand correctly, your problem is not related to the API implementation, but with the pagination of the results. If that's the case, there's lots of pagination examples on the web. I remember that I used PEAR::Pager a long time ago, you can find it at http://pear.php.net/package/Pager