Fetch single album photos to our website from Facebook

Posted by Vickypatel under JavaScript on 12/29/2014 | Points: 10 | Views : 478 | Status : [Member] | Replies : 1
Here is the code for fetching single album photos to website:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
(function ($) { $.fn.fbAlbum = function (f) { var g = this; var h = { 'albumID': 10150302289698306 , 'limit': 2000 , 'ulClass': 'album', 'callback': '', 'title': true }; if (f) { $.extend(h, f) } var i = "https://graph.facebook.com/" + h.albumID + "/photos?limit=" + h.limit + "&callback=?"; $.getJSON(i, function (a) { var b = []; for (var c in a) { for (var d in a[c]) { val2 = a[c][d]; if (typeof (val2.source) != "undefined") { var e = ""; if (h.title && val2.name) { e = val2.name } b.push('<li><a class="imageLink" rel="group" href="' + val2.source + '"><img src="' + val2.picture + '" title="' + e + '"/></a></li>') } } }; $('<ul />', { 'class': h.ulClass, html: b.join('') }).appendTo(g); if (h.callback) { h.callback() } }); return this } })(jQuery);
$(document).ready(function () {
$('#FBalbum').fbAlbum({
'albumID': 514742801922574
});
});
</script>


Underlined highlighted code need to be replaced as per albumid and limit required.

Refer below link for the same: http://kb.concept.co.in/_layouts/15/start.aspx#/Lists/Posts/Post.aspx?ID=95




Responses

Posted by: Sheonarayan on: 12/29/2014 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Is it a question or a solution?

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Vickypatel, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response