Category Archives: Google Plus

PHP: how to query sharing and likeing count from Facebook, Twitter, Google Plus

/** * * @param string $content_url */ public static function getFacebookShareCount( $content_url=” ) { if ($content_url == ”) return 0; $result = array(); $url = “http://api.facebook.com/restserver.php?method=links.getStats&urls=”.urlencode($content_url); $xml = file_get_contents($url); $xml = simplexml_load_string($xml); $result[‘share’] = (int)$xml->link_stat->share_count; $result[‘like’] = (int)$xml->link_stat->like_count; $result[‘comment_count’] = … Continue reading

Posted in Facebook, Google Plus, php, shared content, Twitter | Leave a comment