Facebook graph api comment count

seems Facebook changed the result of posts, few weeks ago it was possible to read the comment count from the post directly

https://graph.facebook.com/125909647492772_502974003098530

you got something like

...
"comments": {
"data": [
  {
    "id": "502974003098530_78616446", 
    "from": {
      "name": "Mathias Fritz", 
      "id": "526559276"
    }, 
    "message": "saugeil!", 
    "can_remove": false, 
    "created_time": "2013-03-26T14:58:01+0000", 
    "like_count": 1, 
    "user_likes": false
  }
], 
"paging": {
  "cursors": {
    "after": "MQ==", 
    "before": "MQ=="
  }
}, 
"count": 1

but now the count is missing.

I did some research on the graph documentation but the only change in that direction seems to be that comments can have comments now... and those comments are counted in a field named comment_count.

Is there still a way to get the total comment count?

Answers


You can get total comment count via FQL. See this question below as reference:

Facebook API - comment count via FQL

Here's the query you need: SELECT comment_info FROM stream WHERE post_id = ...


To get the count, add ?summary=1 at the end: https://graph.facebook.com/125909647492772_502974003098530/comments?summary=1


I was having same problem, just adding likes.summary(true),comments.summary(true) in parameter in against "fields" worked for me.

e.g. I used https://graph.facebook.com/me/feed?access_token=ACCESS_TOKEN&fields=story,from,story_tags,likes.summary(true),comments.summary(true)

instead of https://graph.facebook.com/me/feed?access_token=ACCESS_TOKEN

Also you can add other parameters if you want; separated by a ,


Need Your Help

Ajax close listener for p:confirmDialog

ajax jsf jsf-2 primefaces

I have a confirmDialog and I need to do some action when the dialog is canceled. I've attached that action to 'close' button, but I need to do that also when user click 'x' icon in the top corner. ...