The new API uses cursor based pagination which should give use what we need to re-implement the pagination options and methods in v2.
This issue has been automatically marked as stale because it hasn't had new comments in the last 3 months. It will be closed if no further activity occurs. If you still need assistance with this issue, or believe it shouldn't be closed, please respond with a new comment to let us know.
Thank you all for your contributions.
Still working on this.
Still working on this.
Please :)
Hi,
Any development? tks
Hi, Could you please let me know if the next() method has been implemented in v2? Thanks.
Hey everyone! Thanks for the patience on this feature — it's taken me a while to find some spare time to work on this.
Good news though: pagination will be available in the next release! 🎉
The v2 version of pagination will use the same API that was used in v1, while addressing some of the quirks that v1 had in regards to the limit option when used with pagination.
I'll have more details available once the next release is published.
Thanks!
Hi,
Great news. thank you very much for your support!
Hey folks! Just wanted to let everyone know that v2.0.0-rc3 is now available, and includes pagination support. (Sorry it took me so long!)
The v2 version of pagination uses the same two methods that v1 used:
hasNext() -> bool - returns true/false if there are additional images that can be shown.next() - fetches the next set of images.In addition, v2.0.0-rc3 adds a new option: apiLimit: number.
This option can be used to control how many images are requested from the Instagram API, overriding the limit option when set. This is especially useful when using the filter option, where you may want to display 10 images, but need to fetch _more than 10_, since some will be filtered out.
Internally, Instafeed.js will pool unused images (when apiLimit > limit), and transparently treat those unused images as "pagination" data.
So if you set apiLimit: 10 and limit: 1, Instafeed.js will fetch _up to 10_ images from the Instagram API, and then insert 1 into the page, saving 9 into the internal pool.
At that point, hasNext() will return true, and next() will continually fetch 1 more image (based on limit: 1) from the 9 unused images, until 0 are left.
Once all the pooled images have been displayed, hasNext() will return true if the Instagram API provided a pagination cursor during the initial request, and next() will fetch the next set of 10 images (based onapiLimit: 10) from the API, starting the process over.
Hopefully this extra functionality can cover some edge cases that v1 had!
Please give RC3 a shot and let me know if you run into any issues!
Hey folks! Just wanted to let everyone know that v2.0.0-rc3 is now available, and includes pagination support. (Sorry it took me so long!)
Good News!
Thank you, I will try to implement!
Most helpful comment
Hey everyone! Thanks for the patience on this feature — it's taken me a while to find some spare time to work on this.
Good news though: pagination will be available in the next release! 🎉
The v2 version of pagination will use the same API that was used in v1, while addressing some of the quirks that v1 had in regards to the
limitoption when used with pagination.I'll have more details available once the next release is published.
Thanks!