views:

231

answers:

1

I use on my website, but I can't figure out how to retrieve the comment count from a comment box with a specific XID.

I've tried intercepting all new comments with the following code:

FB.Event.subscribe('comments.add', function(response) { alert("Comment was added."); });

I never receive the alert though. Any ideas? I just need the number of comments for any given box.

+1  A: 

You should be able to get comment_count field from link_stat table through FQL by providing url of a page with your comment plugin.

If that doesn't work you can also get all comments by xid from comment table and then count them yourself (FQL doesn't support COUNT). But there is a limit on returned number of records, so most likely it would return only first 5,000 comments.

serg
I also need to detect when a new comment is added so I can notify the site owner.
thinkswan