0

Facebook live Feeds display inside my website as FBML is deprecated instead of using that, is there any simplify method to do same task in java script, display feeds and comments to that feeds. URL http://developers.facebook.com/docs/reference/javascript/

4

1 回答 1

0

Fetching Current Logged in User's News Feed through JS:

FB.api('/me/home', function (response) { 
       console.log(response) 
});

Corresponding HTTP GET
http://graph.facebook.com/me/home?access_token=UserAccessToken

EDIT (Simple Example)

Assuming you have extended permission read_stream

<input type="button" value="test" onclick="GetFeeds()" />

function GetFeeds() {
FB.api('/me/home', function (response) { 
   for (var i = 0, l = response.data.length; i < l; i++) {
    var post = response.data[i];
    var name = post.from.name;
    var msg = post.message;
    alert("Posted By: " + name + " Message: " + msg);
});
}
于 2013-02-12T10:03:34.050 回答