質問

I am trying to pull a public page from facebook using php and json to sort the data received. I have everything working perfectly apart from replies on comments on posts. I can get all the list of comments on a post but the replies to that comment do not appear on the json data that is returned to me. I believe when the user of the page comments on his own post the story tag is given to the comment and it is unrelated to the comments section of that post. But if anybody else replies to a comment i cannot see their message anywhere. Is there any way to try and get the replies of comments returned in json along with everything else?

役に立ちましたか?

解決

edit: found a better solution

see the answer here: How to get the image from a facebook photo comment?

the query you want to perform is

/{page-post-id}/comments?fields=from,message,id,attachment,created_time,comments.fields(from,message,id,attachment,created_time)

to query this via PHP you would do something like this:

$page_comment_id = 12345; // put your id here
$access_token = ''; // put your facebook access token here
$url = 'https://graph.facebook.com/' . $page_comment_id . '/comments?fields=from,message,id,attachment,created_time,comments.fields(from,message,id,attachment,created_time)&access_token=' . $access_token;
$data = json_decode(file_get_contents($url),true);
print_r($data);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top