vendredi 16 août 2013

php twitter followers count and facebook likes count without login

Numbers of likes on facebook page
         $name = 'PAGE';
         $src = json_decode(file_get_contents(''.$name));
    $likes= $src->likes;
echo $likes;

Twitter  code is different i've found this hack on the web (y)
with the code below no need to connect with valid credentials:

$src = file_get_contents($url);
$decoded = json_decode($src);
echo ($decoded->query->results->strong[2]);

where XXXXXXX is the account
it works tested on a joomla integration.

Aucun commentaire:

Enregistrer un commentaire