I found people like this:

<?php require_once __DIR__ . '/php-graph-sdk-5.0.0/src/Facebook/autoload.php'; $ACCESS_TOKEN = "EAAPMsX1FZCcwBAMoZBJcSvoZByUH1osyWMkcNiLdKQbfNxQzV7c75qiEHZCXtZB9XBpiiktbVCRhoZAfiZAoc9180oMnA7t01LmrfDFZCuO2ZCfzhqeeWfIVg8VchQXUTz6sTZBEBqZCXDWo2iYZAiqlpav4oZCG1ualiyjXZAWndgu6MeTwZDZD"; $fb = new Facebook\Facebook([ 'app_id' => '1069487613148620', 'app_secret' => '6d2009f84a43bccf600c3754eac71b5c', 'default_access_token' => $ACCESS_TOKEN, 'default_graph_version' => 'v2.8' ]); try { $response = $fb->sendRequest('GET', '/946879378758790_1070701743043219/shares', array('summary' => true), $ACCESS_TOKEN, 'eTag', 'v2.8'); } catch (Facebook\Exceptions\FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(Facebook\Exceptions\FacebookSDKException $e) { // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } $likesEdge = $response->getGraphEdge(); $totalCount = $likesEdge->getTotalCount(); echo "REPOSTS TOTAL: " . $totalCount; ?> 

Tell me how to do the same with repost.

  • Format the question and there will be more willing to help you. - Isaev

1 answer 1

 <?php require_once __DIR__ . '/php-graph-sdk-5.0.0/src/Facebook/autoload.php'; //$ACCESS_TOKEN = "102688566892314|sYsTLEmbV9eGbUG7sE_4zSBGCHg"; $ACCESS_TOKEN = "EAAPMsX1FZCcwBAMoZBJcSvoZByUH1osyWMkcNiLdKQbfNxQzV7c75qiEHZCXtZB9XBpiiktbVCRhoZAfiZAoc9180oMnA7t01LmrfDFZCuO2ZCfzhqeeWfIVg8VchQXUTz6sTZBEBqZCXDWo2iYZAiqlpav4oZCG1ualiyjXZAWndgu6MeTwZDZD"; $fb = new Facebook\Facebook([ 'app_id' => '1069487613148620', 'app_secret' => '6d2009f84a43bccf600c3754eac71b5c', 'default_access_token' => $ACCESS_TOKEN, 'default_graph_version' => 'v2.8' ]); //$request = $fb->request('GET', '/363865183112_10154190067888113/likes?summary=true'); //203190063704_10154125012873705 try { $response = $fb->sendRequest('GET', '/946879378758790_1070701743043219/shares', array('summary' => true), $ACCESS_TOKEN, 'eTag', 'v2.8'); } catch(Facebook\Exceptions\FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(Facebook\Exceptions\FacebookSDKException $e) { // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } $likesEdge = $response->getGraphEdge(); $totalCount = $likesEdge->getTotalCount(); echo "REPOSTS TOTAL: " . $totalCount; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>test</title> </head> <body> </body> </html>