jquery – Filter instagram api results by tag AND username

jquery – Filter instagram api results by tag AND username

Looking through the code provided by the user on his figured it out website, the solution was as follow:

imgLimit = 1000;
// Grab all TAGS of choice
$.ajax({
    type: GET,
    dataType: jsonp,
    cache: false,
    url: https://api.instagram.com/v1/tags/TAG_OF_CHOICE/media/recent?client_id=CLIENT_ID&access_token=ACCESS_TOKEN,
    success: function(data) { 
    // Loop through the data and only add the images that match a certain user ID
        for (var i = 0; i < imgLimit; i++) {
            var usertag = data.data[i].user.id;
            if (usertag === USER_ID_OF_CHOICE) {
                // Add image to page
                addImage(data.data[i]);
            }
       }
    }
});

jquery – Filter instagram api results by tag AND username

Leave a Reply

Your email address will not be published. Required fields are marked *