javascript - Limit with filter - instafeed.js -



javascript - Limit with filter - instafeed.js -

i using great tool of instafeed.js interact instagram’s api. trying filter results image.type === 'video'. have been able work. problem never satisfies limit:10 set. somehow may pulling types(image , video) , applying filter. possible meet limit 10 while applying filter 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) { homecoming image.type === 'video'; } });

you correct, filter applied after limit option.

to around that, seek setting limit higher number, removing images after fact:

var feed = new instafeed({ limit: 30, 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) { homecoming image.type === 'video'; }, after: function () { var images = $("#instafeed").find('div'); if (images.length > 10) { $(images.slice(10, images.length)).remove(); } } });

you can check this thread on github more details.

javascript jquery instafeedjs

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -