i am develpoing the app which retrieve the logged user current comment on facebook wall and no of like for comments.
I stuck with the Javascript api. Can anyone tell me how to access the comment object through JavaScript api. do i need to get access_token? if yes to obtain the access_token.
And how can we obtain the dat开发者_StackOverflowa within comment array?
This should be all you need to get the logged in user's wall posts.
FB.api('/me/statuses/', function(response){console.log(response);});
A few notes:
- If the user is logged in, the SDK takes care of all access_token issues. You don't have to worry about it.
- "me" refers to the logged in user
- "statuses" refers to the user's status updates. You could also use "feed" here, but that would be a list of all posts on the user's wall, which might include some posts from others.
The response will be an array of status messages, ordered by most recent to oldest.
If the status has been liked by anyone on Facebook, there will be a "likes" object that contains the names and IDs of the likers included with each post. Comments are also included. You can use the console in Chrome to explore the data structure in detail.
精彩评论