How can I fetch number of shares every 5 minutes for specified URL?
Here is my code for getting number of shares from twitter:
function twittershares($url) {
$s = file_get_contents("http://urls.api.twitter.com/1/urls/count.json".
"?callback=?&url=".urlencode($url));
preg_match("#(\"count\"):([0-9]*)#",$s,$ar);
return isset($ar[2]) ? $ar[2] : 0;
}
echo twittershares("http://abc1234.com");
Thanks