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}} ♥ </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}} ♥ </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
Post a Comment