Last active
May 3, 2016 08:09
-
-
Save henrytran9x/f232ec88946e5cca26a0 to your computer and use it in GitHub Desktop.
This API facebook URL get comment count,share count , like count from Link ..this Render json string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static function get_the_fb_like( $url = '' ){ | |
$pageURL = 'http://nextopics.com'; | |
$url = ($url == '' ) ? $pageURL : $url; // setting a value in $url variable | |
$params = 'SELECT comment_count, share_count, like_count FROM link_stat WHERE url = "'.$url.'"'; | |
$component = urlencode($params); | |
$url = 'http://graph.facebook.com/fql?q='.$component; | |
$fbLIkeAndSahre = json_decode(file_get_contents($url)); | |
$getFbStatus = $fbLIkeAndSahre->data['0']; | |
return $getFbStatus; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment