Henry Try this with a cycle of up to $ Comments and $ Likes | "This will return comments and comments from post 0 data. For each message, besides this, you need to add a new array. I saw how you are trying to encode an array request, I could never use this method to work; comments and likes exist in a separate table so to speak. "
NOTE. A packet only accepts a maximum of 20 requests, so a request for 999,999 messages in a loop will still only return the first 19 comments / comments, given that the first request is a message.
$queryProfileFeed = array( array('method' => 'GET', 'relative_url' => '/me/feed?fields=id%26'.$app_access_token.'' 'name' => 'getLnC', 'omit_response_on_success' => false), array('method' => 'GET', 'relative_url' => '/{result=getLnC:$.data.0.id}/comments?fields=id%26offset=0'), array('method' => 'GET', 'relative_url' => '/{result=getLnC:$.data.0.id}/likes?fields=id%26offset=0'), ); $batchResponse = $facebook->api('?batch='.json_encode($queryProfileFeed), 'POST'); $Comments = json_decode($batchResponse[1]['body'], true); $Likes = json_decode($batchResponse[2]['body'], true);
I use the above method, but with lots of batch requests to show my wall in my plugins
but I only request the first 2 comments and like it from the first 10 posts. Moreover, it seems that performance degradation and often time out throw errors like "not an exsist alias"
source share