In my effort to remove all badges from my front page and decrease the load time, I have now moved to using the Technorati API to display Technorati info. It looks like this:

The code is almost as easy as the code to display your FeedBurner subscribers or your last tweet. You’ll need to create an account with Technorati and then get your API key. That page will also tell you how much queries you’ve made that day, and what your daily allowance is.
This is the code, including caching:
$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>";
That’s it! Let me know if you’ve got any questions!



Very cool! Now, I don’t have the much special things going on on Technorati, But it is very cool to see this kind of coding! :D Keep it up I would say!
I think this could be more easily done with simplexml object? Correct me if I’m wrong :)
@smott: Why load an entire simplexml object for a couple of regexes? :) And on top of that, that’s not available everywhere, this is :)
I would say that it always better to do all these with javascripts (feedburner feed count or technorati links)…why do you want to hit the wp database for every showoff?
server sided scripting is not only costly for these showoffs…but they are also incompatible with caching plugins like super cache…
@rajesh using javascript would cause extra stress on the end user (mobile, overseas, library etc.) and also negate potential SEO benefits of additional dynamic text on your site.
while I’m not so worried about the SEO benefits, I do worry about the extra scripts. Before I added this, my homepage footer would sometimes take 5-6 seconds to load…
@joost, you have a point there. I didn’t think in the way of availability and performance but only in the matter of simplicity :)
@rajesh, not everyone has javascript enabled.
Cool. I do not have lots to brag about on Technorati at the moment but now I know how to show the stats when the situation changes. Thanks.
Again, good post this. I’ll have to gain some ground before I get this going.
@Joost,
i am not even sure about what SEO benefits he (CVOS man) is talking about…but i do agree with you that you could make the footer load better with the php script than with the javascript under normal circumstances…(when there is no sudden traffic surge)…
@smottt,
i know that….even google analytics is a javascript and many are living with it…i wouldn’t be too interested on the visits from people who do not enable javascript…as there are no conversions and i am not optimizing my site for them…it is not a big deal if they don’t see the feed count or no. of technorati links…
Cool script. I am using it in my footer, and the loadtime hasn’t changed much.
My Technorati rank is nothing to be proud of though, but now it’s easy for me to follow it :)
Tried to use it on my website but did not work. Where do i paste the code in my blog.
My technorati rank is slowly rising, I don’t have much to brag about now, but maybe in a few months I can. I’m almost at the 100,000 mark :) .
Do you think there is a benefit to having the technorati badge there?
I personally think that it may make a good impression to others about your blog, but thats about it.
real nice tip… keep them coming
I’ll echo VPS_WebHosting’s query. I’ve pasted the code to my footer, and my footer displays the code (including my API key). I’ve also included and excluded the “snoopy” line: The only difference that made was to display that line along with the rest of the code.
Nice Query, I’m going too see if this can be ingrated into my website design.
Good tips.Having a good Technorati rank seems to be important because it is so respected,Is it possible to increase your rank by putting technorati-tags directly in your blog posts?
thats great that you are talking about the twitter api,a good example of searching with the twitter api is on twiogle.com because you can search on twitter and google at the same time.
WOW!
This is amazing. Using the Technorati API on our blog would give a better picture of the website in the entire community. However, it’s more suitable to successful blogs, web pages with tons of traffic, a lot of readers and subscribers, a large number of backlinks and high rankings.
For a new blog, showing such an API would not seem so exciting. I guess this would work well for intermediate bloggers who are in the right path of success!
But again, thanks for providing the code about Technorati info.
Regards,
Hooshmand Moslemi
Hello Yoast,
There are a lot of comments of your blog, I’m sure you can’t possibly have enough time to read them, but anyway I’d just like to thank you for your hands tips – you also have a really nice looking site. I’m glad I’m on your mailing list and I can honestly say that yours if one of the few emails that actually teaches me something.
All the best
Simon
Very nice tips !!!
Hi pl send full code