<?php $fb = facebook_shares("http://www.facebook.com/redbull"); ?>
Here's the full code:
<?php function facebook_shares($url){
$fql = "SELECT url, normalized_url, share_count, like_count, comment_count, ";
$fql .= "total_count, commentsbox_count, comments_fbid, click_count FROM ";
$fql .= "link_stat WHERE url = '".$url."'";
$apifql="https://api.facebook.com/method/fql.query?format=json&query=".urlencode($fql);
$fb_json=file_get_contents($apifql);
return json_decode($fb_json);
}
?>
<?php $fb = facebook_shares("http://www.facebook.com/redbull"); ?>
<?php echo $fb[0]->share_count; ?>
Why would the code hang and the page not load? Any ideas?
Thanks