tonymx227
tonymx227

Reputation: 5451

Issue using instagram-node

I get an issue using the module Instagram-node, I'm not able to get all the medias... There is a limit and I don't want this limit, I want to get all the medias of the current user...

My code :

    self.api.user_media_recent(userId, function(err, medias, pagination, remaining, limit){
      console.log(medias.length); // only 35... should be 200 or something like that...
      medias.forEach( function(media){
        var url = media.images.thumbnail.url;
      });
      response.render('home/photos', {medias: medias, type: request.query.state});
    });

Upvotes: 2

Views: 862

Answers (1)

user385729
user385729

Reputation: 1984

Based on the documenation, the result is paginated, you need to do the following:

var hdl = function(err, result, pagination, remaining, limit) {
  // Your implementation here
  if(pagination.next) {
    pagination.next(hdl); // Will get second page results
  }
};

ig.tag_media_recent('test', hdl);

Upvotes: 3

Related Questions