Facebook graph api comment count

后端 未结 9 796

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_502

9条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-01 20:21

    Or to make less changes to you excisting code, use:

        $.each(json.data,function(i,fb){
        ...
           var commentsCount = 0
           if(fb.comments!=undefined){
              commentsCount=fb.comments.data.length
           }
        ...
        }
    

    commentsCount holds number of comments for active child

提交回复
热议问题