How to Display Technorati Stats on Your Blog

Loading time is one of the major factor that may conglomerate visitors on your website. There are many techniques to cut down long load times of your blog. One of which can be using less third party content like badges images etc.

Now many of the bloggers like to display a Technorati badge showing thier blog’s Technorati Stats on their websites. Below is a small piece of code with which you can put up your blog stats on Technorati using the Technorati API.

The code is very simple to put up, also if you are familiar with PHP and HTML then you can use your own style to put the stats on your blog or website.

Have a look at the code…

$technorati = get_option("technorati");
if ($technorati['lastcheck'] < ( mktime() - 600 ) ) {
	$apikey 	= "apikey";
	$endpoint 	= "http://api.technorati.com/cosmos?key=".$apikey;
	$request 	= $endpoint."&url=yoast.com&limit=10";
	$snoopy 	= new Snoopy;
	$result 	= $snoopy->fetch($request);
	if ($result) {
		$pattern1 = '/<inboundblogs>([0-9]+)<\/inboundblogs>/';
		$pattern2 = '/<inboundlinks>([0-9]+)<\/inboundlinks>/';
		$pattern3 = '/<rank>([0-9]+)<\/rank>/';
		preg_match($pattern1, $snoopy->results, $matches);
		preg_match($pattern2, $snoopy->results, $matches2);
		preg_match($pattern3, $snoopy->results, $matches3);
		$technorati['inboundblogs'] = number_format($matches[1]);
		$technorati['inboundlinks'] = number_format($matches2[1]);
		$technorati['rank'] 	= number_format($matches3[1]);
		$technorati['lastcheck']= mktime();
		update_option("technorati",$technorati);
	}
}
echo "<h3>Technorati</h3>";
echo "<p>".$technorati['inboundblogs']." blogs linked
	".$technorati['inboundlinks']." times in the last 6 months,
	ranking it as ".$technorati['rank']." among all blogs.</p>";

Thanks to Yoast

Related posts:

  1. 3 Working Ways that get More Traffic to blog
  2. Adsense Kontera Or Adbrite ? Which one to choose ?
  3. Its time to Upgrade your WordPress Again – How to Upgrade from WordPress 2.6.2 to WordPress 2.6.3


The author is a small business owner himself specialising in Web Development. He runs Insight Studios which offers specialized Web Development, SEO Services and PPC Management for Small Business and SME thus ensuring growth and prosperity using the power of social media.

Share This Post

Related Articles

Leave a Reply

© 2012 MyGeekPal. All rights reserved. Site Admin · Entries RSS · Comments RSS
Designed by Insight Studios