Quantcast
Viewing all articles
Browse latest Browse all 32

Limit with filter - instafeed.js

I am using the great tool of instafeed.js to interact with instagram’s api. I am currently trying to filter results to only be image.type === 'video'. I have been able to get that to work. The only problem is that it never satisfies the limit:10 set. Somehow it may be pulling all types(image and video) and then applying the filter. Is it possible to meet the limit 10 while applying a filter for videos only?

var feed = new Instafeed({
  limit: '10',
  sortBy: 'most-liked',
  resolution: 'standard_resolution',
  clientId: 'xxxxx', 
  template:'<div class="tile"><div class="text"><b>{{likes}} &hearts; </b>{{model.user.full_name}}</div><img class="item" src="{{image}}"></div>',
  filter: function(image) {
    return image.type === 'video';
  }
});

Viewing all articles
Browse latest Browse all 32

Trending Articles