- 🇺🇦Ukraine AstonVictor
I'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks
/***
*For count for facebook like of particular node , you may further calculate for other requirements.
But it is little bit slow
***/
//-------------------- 1st method -----------------------//
$nod = 2; // node id
//$alias_val = drupal_get_path_alias($path = $_GET['q'], $path_language = NULL);
$alias_val = drupal_get_path_alias($path = 'node/'.$nod, $path_language = NULL);
$fql = "SELECT like_count FROM link_stat WHERE url ='".$base_url."/".$alias_val."'";
$jdata = json_decode(file_get_contents('https://api.facebook.com/method/fql.query?format=json&query=' . urlencode($fql)), true);
$tot_like = $jdata[0]['like_count'];
// --------------2nd method----------- //
$alias_val = drupal_get_path_alias($path = 'node/'.$nod, $path_language = NULL);
$furl = $base_url."/".$alias_val;
$jdata = "http://api.facebook.com/restserver.php?method=links.getStats&urls=".$furl;
$xmlinfo = simplexml_load_file($jdata);
$tot_like = $xmlinfo->link_stat->total_count;
//-------------------- 3rd method ------------------------//
$url = 'http://example.com/home-page';
$jdata = "http://api.facebook.com/restserver.php?method=links.getStats&urls=".$url;
$xmlinfo = drupal_http_request($jdata);
$fresult = explode(" ",$xmlinfo->data);
if($fresult[25]>0) {
$tot_like = $fresult[25];
Closed: outdated
2.2
Miscellaneous
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks