Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instafeed: skip retrieving video type posts from feed

I want to skip all video type posts from a feed that I'm gathering through the Instafeed JS plugin. Read from a few other posts that setting a filter would solve it but if I apply this (see below) I only get 2 images instead of 5. 1 of those 5 are a video type and the rest are image types. Not sure whats going on here?

var loadButton = document.getElementById('instafeed-loadmore');
            var feed = new Instafeed({
                get: 'user',
                type: 'image',
                limit: '5',
                sortBy: 'most-recent',
                resolution: 'standard_resolution',
                userId: '',
                accessToken: '',
                template: '<div><a href="#" data-modal="instafeed-expand" data-caption="{{caption}}" data-image="{{image}}"><img src="{{image}}" data-etc=""></a></div>',
                filter: function(image) {
                    return image.type === 'image';
                },
                after: function() {
                    if (!this.hasNext()) {
                        loadButton.setAttribute('disabled', 'disabled');
                    }
                },
            });

            loadButton.addEventListener('click', function() {
                feed.next();
            });
like image 364
Staffan Estberg Avatar asked Oct 17 '17 05:10

Staffan Estberg


1 Answers

Maybe removing the resolution parameter should help. Also I dont think

type: 'image',

is a valid argument. I cant find it in the instafeed documentation as well.

like image 105
cyberrspiritt Avatar answered Oct 02 '22 14:10

cyberrspiritt