3

Any ideas how to get the likes/comment count from a Facebook post - fast? My idea was to get the stats of every single post, but it takes too long.

$post = $facebook->api("/".$array['PostID']."/?fields=comments,likes", array());
$likes_count = count($post['likes']['data']);
$comments_count = count($post['comments']['data']);

I also tried to do it with a batch request like:

$buildQuery .= '{"method":"GET","relative_url":"'.$array['PostID'].'/?fields=comments,likes"}';

The problem here is, that it doesn't work, because batch requests supports only POST mode.
What should I try? Any ideas?

Mirza Sisic
  • 2,401
  • 4
  • 24
  • 38

0 Answers0