monkinetic weblog | redmonk.net

Since 1999, IX Ed.

Implementing Machine Tagging

Tuesday, August 7th, 2007

Ok, so last week Jodi and Adelina were off in Colorado (I’m sure Jodi will blog it soon), so I was home alone quite a bit. So what did that mean? Hackery!

After exploring some machine tagging and some UI bits and pieces for machine tags on the site, I spent some time completely rewriting my machine tagging code. I started with blog:via as my first machine tag, then quickly added tags for movies in Netflix (netflix:id), books at Amazon (book:isbn) and other Amazon products (amazon:asin). Here’s a post with a blog:via tag and a book:isbn tag. And here’s one with a netflix:id tag and an amazon:asin tag.

Implementation

I’ll admit, the implementation is still a bit scattered. This blog is powered by WordPress, so to start with the tags themselves are added to posts via a custom field called ‘machinetags’ - one entry for each tag:

machinetags-1

WordPress’s template tags make it easy to get at those values as an array, which I pass to a WordPress plugin I wrote just for this. The plugin builds the initial display for the related items, adding ids and classes as hooks for the next bit.

machinetags-2

When the page loads, I wrote some javascript (using JQuery) that attaches custom event handlers to the click events for the “more posts” and “view” links. The handlers fire off ajax calls, so that I’m not making a lot of ajax calls as the page initially loads (which would increase page load times for something that only some readers are going to be interested in).

As you can see here, clicking the links loads related content inline:

machinetags-3

Strategies

So far, all my tags live here on this site, attached to my posts. Jeremy Keith uses this same strategy, and adds a “tags in the cloud” tactic - assigning adactio:id=... tags to photos on Flickr, then doing a Flickr search to pull in photos when a post is viewed. I may explore this a bit more - I’ve been thinking about using Amazon’s tagging feature to add a monkinetic:id=... tag, then doing the lookup that way, but for products it feels more appropriate to have the hook/tag on this end.

APIs

Machine tagging is going to succeed or fail on the strength of the APIs that services offer. Amazon, while not being a posterboy for Web2.0, has an amazing REST API that is pretty easy to work with once you get the hang of it. (I’m using a technique that - acronym alert - runs Amazon’s XML output through an XSL stylesheet hosted on my server via Amazon’s own XSLT service to produce JSON.) I use it for looking up books as well as any other product Amazon offers.

Netflix, on the other hand, has no API, and I had to resort to figuring out the URLs that use Netflix’s internal movie ID to make a link to the site and grab the cover thumbnail. I would love to actually show the movie title and average rating, but there’s no api for it.

I also looked at IMDB but could not find even so much as a predictable way to devine a movie poster image from an IMDB title id, so while I may add imdb:title=... tags to some of my posts, I won’t be able to provide related content inline. This is really a pity, as both Netflix and IMDB are probably afraid that if they provide easy access to their content via an API, competitors might use it to disrupt their market. Well, that might be the case, but there are a LOT of us out here who would love to send traffic to both Netflix and IMDB in more interesting ways.

If you love something…

As Dave says:

People will only trust a service that gives them complete freedom to come and go as they please. Further, they’ll want to come back if you send them to cool places.

Monkinetic Wordpress widgets update

Wednesday, June 13th, 2007

I can’t remember if I posted about this when I put up the “On This Day In…” widget, but I finally got my widgets (both On This Day In… and the hCard About Box) into the public monkinetic widgets repository. Browse the repository here.

Monkinetic Widgets SVN

Wednesday, April 25th, 2007

My two recent widgets, hCard About Box and On This Day In…, are now in the public SVN. Have at it.

hCard About Box Wordpress Widget

Friday, April 20th, 2007

The hCard Wordpress widget now it’s own page. GPL and MIT licensed. Enjoy.

Full “Franken-site” saga for Drupal.org

Sunday, July 23rd, 2006

After some prodding, I posted the full, and slightly edited, “Building The Franken-site” saga on Drupal.org. It basically covers using XML-RPC as the glue to get Drupal content into a Wordpress template and vice-versa. The next version of this site (under construction now) will work this way.

Using XML-RPC to combine Drupal and Wordpress on a site.

Creating the franken-site

Monday, July 17th, 2006

I’m planning out the next iteration of redmonk.net, and it involves more close integration between the Wordpress blog and the rest of the site in Drupal. If you’re a Drupal hacker, please check out my progress here:

http://www.redmonk.net/more/tech/franken-site-i

You’re It!

Wednesday, March 15th, 2006

I’ve been futzing with tags lately on this site. I’ve wanted to add tagging to my posts for some time (managing categories was too hard), and got around to installing the Ultimate Tag Warrior plugin for Wordpress. It’s impressive in it’s scope of features and complete ease of use. I’ve spent some time tagging the last year’s worth of content (not as much as you might think) and it’s a quick and easy process.

So, the Technorati tags are listed below each post, or - if you click the permalink - you can see links to the local tags.

You can check out my “tag cloudhere to see that “family” is so far my heaviest topic by a small margin, with things like “apple” and “webdesign” in the top 5 or 10.