Search code examples
sharepoint-2013instagraminstagram-api

How to give multiple tag in instafeed


Iam currently using instafeed to display the pictures from instagram with specific hashtag in sharepoint 2013 app and it seems working fine.I want to display the pictures with multiple hashtag. I would like to know that is it possible with instafeed?? i have searched for that but didnt found any solution and if i want to configure hashtag information in sharepoint app .what is the standard method for that. Any tips/help would be very helpfull.


Solution

  • As I know there is no way to specify multiple hashtag using instafeed. But you can write you own JavaScript function to load the feeds from multiple hashtag because instafeed supports to run multiple instances of Instafeed.js in a page, each with their own settings.

    Eg:

      <script type="text/javascript">
            function getMultipleTags (tags) {
                var feeds = [];
                for (var i=0, len=tags.length; i < len; i++) {
                    feeds.push(new Instafeed({
                        // rest of your options
                        get: 'tagged',
                        tagName: tags[i],
                        target: "instafeed-" + tags[i]
                    }));
                }
                return feeds;
            }
    
            // get multiple tags
            var myTags = getMultipleTags(['glass', 'wood', 'rock']);
            // run each instance
            for(var i=0, len=myTags.length; i < len; i++) {
                myTags[i].run();
            }
    </script>
    

    Source : https://github.com/stevenschobert/instafeed.js/issues/12