galen / PHP-Instagram-API

PHP 5.3+ wrapper for the Instagram API
339 stars 159 forks source link

How to get the previous page? #42

Open alexweb-zz opened 9 years ago

alexweb-zz commented 9 years ago

How to get the previous page? I see only Instagram\Collection\MediaCollection::getNext() method.

lucien144 commented 9 years ago

This is not a problem of this library, but Instagram API. Instagram API does not support something like getPrev(). You have to change the max_id to get "previous" media. It's dumb, but that's how it is.

HeathNaylor commented 8 years ago

I am debating implementation of this. If you are doing max_id/min_id what method would I use to pass those into? Looking at how the proxy handles parameters it seems that I can just pass them as an array into getTagMedia() for example.

I am thinking I will need to store the min/max as a json object within the users local storage to truly keep pagination. Frustration in the limited API aside, it might be a better idea to setup a memcache or redis cache to hold the objects for later use. This would help cut down on requests to the api and seems to be what Instagram is hinting at with not providing a getPrev() method.