Reputation: 47
I'm creating one admin site with login system using php. In that I need to calculate the number of likes in facebook for ("www.facebook.com/tarehub") this page in my dashboard... Could anyone help me to do this???
I'm creating fb-like button in end-user site like,
<div class="fb-like" data-href="https://www.facebook.com/tarehub" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
</div>
Thanks in advance,
Sanjita
Upvotes: 0
Views: 154
Reputation: 134
if I understood you correctly, try this (replace http://www.google.com to your URL)
http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.google.com
or using FQL (!deprecated!)
Upvotes: 0
Reputation: 275
You can try this code for fb like count
$ch = curl_init("http://graph.facebook.com/tarehub");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$raw = curl_exec($ch);
curl_close($ch);
$data = json_decode($raw);
echo $data->likes . " likes";
Upvotes: 1