Skip to content

Instantly share code, notes, and snippets.

@cmuench
Created September 24, 2010 08:54
Show Gist options
  • Save cmuench/595075 to your computer and use it in GitHub Desktop.
Save cmuench/595075 to your computer and use it in GitHub Desktop.
<?php
$cURLSession = curl_init();
curl_setopt($cURLSession, CURLOPT_URL, sprintf('http://graph.facebook.com/%s', 'XXXXXXXXXXX')); // remplacer XXXXXXXXXXX par l'id de votre page Facebook
curl_setopt($cURLSession, CURLOPT_RETURNTRANSFER, 2);
curl_setopt($cURLSession, CURLOPT_CONNECTTIMEOUT, 2);
$apiResult = curl_exec($cURLSession);
curl_close($cURLSession);
$apiResult = json_decode($apiResult);
echo $apiResult->fan_count;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment