在instafeed.js中,我可以sortBy
或most-liked
most-recent
标记图片。这些选择是互斥的。我试图找到一个做好两者的中间立场。我想按most-recent
排序,然后显示likes > x amount
的那些。我怎样才能在instafeed.js中实现这个目标?
var feed = new Instafeed({
target: 'instafeed',
get: 'tagged',
tagName: 'dog',
limit: '10',
sortBy: 'most-recent',
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) {
//filter for recent images with most like
}
});
答案 0 :(得分:2)
根据此https://github.com/stevenschobert/instafeed.js/issues/21,过滤器函数中的image
参数具有属性likes
。所以你应该能够做类似
filter: function(image) {
return image.likes.count >= minAmount;
}