Search code examples
rubykoala

Retrieve comments and replies with Koala gem


maybe this is stupid question, but how to retrieve comments and their replies (last 50) from Facebook profile page? For example: api.get_connections("depechemode","posts") (or feed) give me only comments. Do I really have to create another request for every comment to get its replies? Is there better way to obtain all responses (comments + replies) from posts?

I tried FQL with "googled" examples, but without success...

UPDATE: I can get comments+replies from post with api.get_connections(post_id,"comments", :filter="stream") but is there any other option? It will be nice to get posts+comments+replies with one request...


Solution

  • I'll answer to myself:

    graph.get_connections("askdotcom", "posts", :fields=>"message,id,created_time,comments.fields(comments.fields(from,message),message,from),from")

    Just had to play with Graph API Explorer