Announcement Announcement Module
No announcement yet.
unable to get all the facebook comment Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • unable to get all the facebook comment

    Hi all,

    I had a facebook post which had 3214 comment.

    Below is my code.

    Post p = facebook.feedOperations().getPost("XXXX_XXXX");
    System.out.println("p:" + p.getCommentCount());
    PagingParameters pp = new PagingParameters(p.getCommentCount(),null,null,nul l);
    PagedList<Comment> comment = facebook.commentOperations().getComments(p.getId() ,pp);
    System.out.println("commentp:" + comment.size());

    The return result is
    p: 3214
    commentp: 951

    Is there anyway I can get all the 3214 comment?

    Thanks for the help
    Last edited by rabbee; Apr 17th, 2013, 04:31 AM.

  • #2
    This is one of the confusing things about the Facebook Graph API. I've noticed this myself. After much frustration have concluded that in *most* cases the problem is a matter of visibility. That is, in reality there is 3,214 comments for that post, but your app only has visibility to 951 of them.

    Again, this isn't always the case; just often the case. And, if it is the case, then no...there's nothing that can be done. I don't know enough about the post you mention above nor about your application, nor about the relationship between the two to be able to say with certainty that's what's going on. But given what I have to work with, that would be one possible explanation. If you do not think that to be the explanation here, then give me a bit more info and I'll try to help.


    • #3
      Hi Habuma,

      Thanks for the reply.

      I found out something. Actually I have create 2 facebook application. The first one is created around the middle of last year and the second one is created last week. I found that the result from these 2 token is different.

      The above problem is because I using the first token which i created last year.

      However, now i try to use the second token which i created last week. I able to get 3082 record. I believe some of the record in the facebook side is delete and the post.getCommentCount is not updated.

      I also found that from the facebook graph API screen. The way the records return are different. For example: In the past comment id is <page id>_<post_id>_<commentid> but with the new token, it return 2 number <commentid1_commentid2>. I guess it is because of the new reply feature from facebook.

      All those are my guess. But I am happy I able to get 3000+ record now.