Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
810 views
in Technique[技术] by (71.8m points)

facebook - Get (Identify) Replies to Comments Using the Graph API

With the new "Reply" to "Comments" feature on Facebook, I've noticed that replies to comments are treated the same as comments. But I was wondering if there is anyway to distinguish the two?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You first have to enable July Breaking Changes from your app advanced settings

Then use the fields parameter with the comments graph API and include the parent.field(id) column with the and also the filter parameter with the stream value. the final result :

{POST_ID}/comments?filter=stream&fields=parent.fields(id),message,from,likes

this should return both comments and replies with the parent element which has the comment id that the reply belongs to

-- update

and for better array arrangement for replies you can use the following to merge replies with the actual comment array you can include comments.summary(true) in the fields parameter

{POST_ID}/comments?limit=0&filter=toplevel&fields=comments.summary(true),message,from,likes

filter parameter is optional

for more info about the fields : http://developers.facebook.com/docs/reference/api/Comment/

and in case you want to do it in FQL, check this post's comments http://developers.facebook.com/blog/post/2013/04/03/new-apis-for-comment-replies/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...