Git Product home page Git Product logo

Comments (2)

n1t0 avatar n1t0 commented on August 17, 2024

Hello @elleryfamilia, I wasn't able to reproduce this bug. Here is the code I used to test it:

var ig = require('instagram-node').instagram({});

ig.use({
  access_token: 'YOUR_TOKEN'
});

var total = 0;
ig.user_media_recent('33082304', {
  count: 5
}, function hdl(err, medias, pagination) {
  if(err) {
    console.log(err.stack);
    process.exit(1);
  }
  else {
    console.log('Retrieved: ' + medias.length);
    medias.forEach(function(m) {
      total ++;
      console.log(m.id);
    });
    if(pagination.next) {
      return pagination.next(hdl);
    }
    else {
      console.log('DONE: ' + total);
    }
  }
});

And here is the result:

Retrieved: 5
782582125351404557_33082304
772569235219285939_33082304
769496680686159334_33082304
768635174150997383_33082304
670314198963849052_33082304
Retrieved: 5
648528023005693777_33082304
605905348387407634_33082304
594988157395797483_33082304
586875837830399032_33082304
576656413601040338_33082304
Retrieved: 5
551537755371603598_33082304
542047178678601586_33082304
475072354173847051_33082304
465868646307333924_33082304
457048997125948468_33082304
Retrieved: 5
449292642763932991_33082304
410541094957483047_33082304
387592920236295630_33082304
377564397194970354_33082304
368622896435955069_33082304
Retrieved: 5
318869204166248215_33082304
295350540825789869_33082304
289076776794326702_33082304
276735699672368947_33082304
269243188481623498_33082304
Retrieved: 5
215899459046081811_33082304
212106853849761343_33082304
191831367508821649_33082304
191829590927476359_33082304
188805059799417887_33082304
Retrieved: 5
181487255320527987_33082304
168159665851729009_33082304
168068493854639644_33082304
168052434091115963_33082304
167987310626079828_33082304
Retrieved: 3
167962406610536413_33082304
164370802763106283_33082304
162681031389087733_33082304
DONE: 38

It seems like it's working fine. Have you any other information about this issue? Could you test the snippet above?

from instagram-node.

elleryfamilia avatar elleryfamilia commented on August 17, 2024

Ah, seems like I missed something. My understanding was that count was limiting the total number of records returned, not just "the page". I'll have to implement something on my end if I want to restrict your example to just 35 records instead of 38. I'll go ahead and close this. Thanks for the sample code!

from instagram-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.