Thursday, March 1, 2012

Now track your Twitter, Feedburner and Delicious Count of website & blog with PHP script

Now track your Twitter,Feedburner and Delicious Count of website & blog with PHP script.It is needed to have SimpleXML and JSON supports in webserver.The output is stored in an array.Just it needs to do is to replace $username and $url variables to own setting.Check bellow:-
//Grab Twitter
$username = 'quenesswebblog';   /* Twitter username */
$api_page = 'http://twitter.com/users/show/' . $username;
$xml = file_get_contents ( $api_page );
$profile = new SimpleXMLElement ( $xml );
$count = $profile->followers_count;
 
$data['twitter'] = $count;
 
//Grab Feedburners
$username = 'queness'/* feedburner feed name */
$xml = file_get_contents ( $api_page );
$profile = new SimpleXmlElement($xml, LIBXML_NOCDATA);
$rsscount = (string) $profile->feed->entry['circulation'];
 
$data['rss'] = $rsscount;  
 
//Grab Delicious
$url = 'www.queness.com';   /* url */
$json = file_get_contents ( $api_page );
$json_output = json_decode($json, true); 
 
$data['delicious'] = $json_output[0]['total_posts'];
 
 
print_r($data);

N.B.[This code snippet was taken from Kevin Liew who is a web designer and developer and keen on contributing to the web development industry]

No comments:

Post a Comment