Technorati Cosmos Links Display for WordPress

Friday, August 17, 2007

Sometimes when I write an article I know that there is a low potential value for comments directly on the article. In these cases, I close comments and encourage linking to the article from other sites, hoping to encourage more thoughtful replies and a richer discourse. Well that’s great, but it’s not much of a discourse if you can’t read both sides.

I needed a simple way to list links back to my posts. Technorati is pretty much the de facto place to go for blog post linking, so I figured I’d check out their API. About 90 minutes later I have a working script that I just include inside of my WordPress theme file:

include 'technorati.php';

I figured other people might have a similar desire or might just be in search of an actual implementation of a Technorati API client in PHP, as their documentation pretty much sucks.

Here’s the source of my quick script: technorati.phps.

You can see the script in action on one of my more controversial posts, like this one. Scroll down just past the article, before the comments and see the “Links to this post” section.

The script is fairly simple, but has a few niceties. First it queries the Technorati API passing in the current post’s URL to get a list of links (if any). Then it gathers info about each link, sorts them by “rank” (number of inbound links to the site in question), removes duplicates (by site name and by URL), and finally displays the list.

Here’s a shot of what it looks like on the aforementioned post:

A view of the links to the post mentioned

The script is by no means a stellar example of PHP code, nor is it as pretty/fast/whatever as it could be. This was just me hammering something out to get some link love displayed on my posts. I’m reasonably satisfied for under two hours of work, though. I might think about packaging this up as a WordPress plugin if there’s enough demand, but I’m spent for now.

written by Brad Fults

Add your thoughts | Trackback URL

Archived at: http://h3h.net/2007/08/technorati-cosmos-links-display-for-wordpress/

Links to this post

Currently tracking 1 reactions to this post. Here is a sampling:

  • Comment Preview
  • Leave a comment

    Comments are posted at the discretion of the site owner. Please try to be respectful, insightful and otherwise useful to society as a whole.

    (X)HTML is allowed. You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <dfn> <em> <kbd> <q cite=""> <samp> <strike> <strong> <sub> <sup> <var>