Friday, 02 August 2013 23:26

how to get comments of a facebook post by Graph api

Written by 
Rate this item
(0 votes)
You may want to show all comments or limited number of comments
for a facebook post in your website(not in facebook).Using Graph api
it can be done easily.Follow my codes here, then details below -
jQuery.ajax({
// async: false,
cache:false,
url:"https://graph.facebook.com/"+post_id_here+"/comments?summary=true&limit=25&access_token="+token_here+"",
dataType: "jsonp",
success:function (data, textStatus, XMLHttpRequest) {
var data=data.data;
},
error:function()
{ },
complete:function ()
{ }
});

Its a jquery ajax call.
Here you need to specify post id for which we retrieving comments,
also it needs any facebook access token for a user.You can generate
token easily for a user.In success function of ajax call we getting
comments in 'data' parameter.you need to understand how to extract
each comment from 'data' structure.

If you have questions about this post or any topics, post your questions in
discussions/forum in this website, you will get your answer


Read 5962 times Last modified on Monday, 19 August 2013 14:35
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.

Latest discussions

  • No posts to display.