It is possible, in two different ways, as long as you have a fixed set of sub-pages you want to fetch comments from.

If you have a large amount of sub-pages, or a variable amount, then you don't have a good scalable solution - and many have been looking for one:

  • Facebook fb:comments Graph API
  • How to display recent comments from Facebook Comments social plugin?
  • Facebook FQL query to return all comments against an application
  • Retrieve all comments with FQL by application ID
  • Facebook FQL query to return all comments against an application
  • fql query to get comment count no longer working
  • http://facebook.stackoverflow.com/questions/10023179/retrieve-all-the-comments-posted-using-fql

For a Fixed set of sub-pages in your website, you can either use a batch request, or an FQL query.

Batch Request


First, you need your access token. Just enter the following as a url in a browser (credit to this website ):

https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=APP_ID&client_secret=APP_SECRET

And this is the javascript jquery code to make a batch request to fetch comments from several urls at once:

$.ajax({
  url: 'https://graph.facebook.com/',
  type : "POST",
  data: {
    access_token : 'YOUR_APP_ACCESS_TOKEN',
    batch : '[ \
    {"method":"GET","relative_url":"URL1"}, \
    {"method":"GET","relative_url":"URL2"} \
    ]'
  },
  success: function(data) {
    jdata = JSON.parse(data);
    $.each(jdata, function(index,value){
        jdata[index].body = JSON.parse(value.body);
        console.log(value.body);
    });
    // Do whatever you want with jdata
  }
});

FQL


inspired from this post

FB.api({
    method: 'fql.query',
    query: 'select text from comment where object_id in (select comments_fbid from link_stat where url="URL1" or url="URL2")'
  }, function(response) {
    // Do something with results
  });

Conclusion

Because of this limitation of Facebook, I plan to switch to disqus.com, which apparently supports this feature (As you can see from this blog, for example. (search for 'recent comments')


Rather than list all the comments on your site, Facebook wants you to implement code to get notified when a new comment is posted anywhere on your site.

To make this happen, you have to put some Javascript into the page where the comment is posted to also notify yourself:

window.fbAsyncInit = function(){
    console.log("subscribing to comment create");
    FB.Event.subscribe('comment.create',function(response){
        console.log("facbeook comment created: " + JSON.stringify(response));
        var commentQuery = FB.Data.query('SELECT fromid, text FROM comment WHERE post_fbid=\'' + response.commentID + '\' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url=\'' + response.href + '\')');
        FB.Data.waitOn([commentQuery], function () {
            console.log("Facebook comment: " + JSON.stringify(commentQuery));
        }); 
    });
};

Where rather than just logging the comment to the console, you would need to implement some AJAX that would send the comment back to your site where you could store the comment in your database, or send yourself an email notifying you that the comment has been posted.