Get the stat of your website with this PHP script. It grab the total number of twitter followers, feedburner subscribers and also delicious bookmarks of your account/website.
PHP
Your webserver need to have SimpleXML and JSON supports. The output is stored in an array. What you have to do is to replace $username and $url variables to your own setting.
//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 */ $api_page = 'https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=' . $username; $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 */ $api_page = 'http://feeds.delicious.com/v2/json/urlinfo/data?url=%20www.queness.com'; $json = file_get_contents ( $api_page ); $json_output = json_decode($json, true); $data['delicious'] = $json_output[0]['total_posts']; print_r($data);
Comments will be moderated and
rel="nofollow"
will be added to all links. You can wrap your coding with[code][/code]
to make use of built-in syntax highlighter.A question, if you call this script to be load, which is the code to insert in our php page where we want to display the numbers ?
thanks, adeux!
echo 'Twitter followers:' . $data['twitter'];
echo 'RSS subscriber:' . $data['rss'];
echo 'Delicious bookmarks:' . $data['delicious'];
have a nice day there
adeux!
https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=queness