Created
November 22, 2018 07:02
-
-
Save khanof89/24610e753b1e27702d5a5ab83fb6a1cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var channel = pusher.subscribe('notify'); | |
channel.bind('instagram-profile-stats-{{isset($username) ? $username : ''}}', function (message) { | |
console.log(message); | |
console.log("==================="); | |
$.each(message.mostLikedPosts, function(index,value) { | |
console.log('index ' + index); | |
$.get('/assets/js/templates/instagram_posts.mst', function (template) { | |
console.log('media url ' + value.media_url + ' image url ' + value.image_url + ' likes count ' + value.likes_count + ' comments count ' + value.comments_count); | |
var rendered = Mustache.render(template, { | |
post: value | |
}); | |
//$('#chatAudio')[0].play(); | |
$('#mostLikedPosts').append(rendered); | |
$('.most_liked_panel').removeClass('hidden'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment