Problem With Trackback

Today I was cleaning up some of the trackback code for WordPress when a number of things struck me about Trackback, which I’m sure someone has thought of before but I’m surprised they haven’t been addressed in the specification.

First off, what is trackback? On movabletype.org there is a Beginner’s Guide to TrackBack that is pretty thorough. Interestingly though they mention the names of several “tools” that have implemented TrackBack (as <strong> no less) they don’t link to any of them. If you’re not familiar with Trackback go read the first section of that to get up to speed.

A commonly requested feature is the ability to send a trackback ping when editing an entry. This has been especially needed since we’ve implemented post status flags (so you can, for example, save your post as a draft and work on it later). There are a couple of logical steps to implementing this, the first of which being that we need to track what pings have and haven’t been sent yet. Then the posting code had to modified a bit to only send trackback pings when an entry was published, and to not ping a URI that had been pinged before, et cetera. Not terribly hard stuff, just a bit of code to go through and some testing to make sure everything worked right.

Now that we have a nice record of pings that have been sent, I thought it would be nice to add that data to the default template for WordPress, as Trackback suffers from the same one-way linking problem it was trying to solve. That is, if I trackback another site my ping will show up in their comments or their trackbacks, but there’s nothing on my site indicating I sent that ping.

Then I realized that this set of pinged URIs I had was close to useless. What does a URI like http://www.movabletype.org/mt/trackback/55 mean anyway? If you enter it in your browser you get an XML error back. If you append a query string to it with ?__mode=rss with some implementations you will get a RSS .91 feed of trackbacks sent from that entry, from which you could extract the actual URI of the resource that http://www.movabletype.org/mt/trackback/55 is relevant to, but what a hassle. You can sweep things like this under the rug with a convoluted “auto-discovery” functionality (which is using sloppily embedded RDF instead of <link>… why?) but these problems are easy enough to solve that they should be.

(A side note, a URI tied to a unique ID system specific to a particular software platform does very little to suggest permanence to me. Are we going to have sent ping URI link rot?)

9 thoughts on “Problem With Trackback

  1. Some excellent points, Matt. Wouldn’t it make more sense to have auto-discovery of the ability to receive TrackBack pings, and just let a CMS that wishes to send TrackBack pings do a ping of every hyperlink made in a post? That would be far more user-friendly for a Weblogger; I always get a little frustrated when I can’t find a URI to ping for folks that don’t make their TB URI’s well-known.

  2. “there’s nothing on my site indicating I sent that ping.”

    There’s MTPingedURLs. But I agree that Trackforths are every bit as relevant as Trackbacks.

  3. Lucian, correct me if I’m wrong, but doesn’t MTPingedURLs contain the trackback URIs? These are stored but they’re not of much use because it’s not a webpage or a document, it’s an interface.

  4. Matt: I knew that in the back of my mind, and I probably should have said something. I guess I’m arguing that TB should act a bit more like PB does.

  5. Chiming in on Geof’s comment, I wonder if PB can actually be made to work with TB. I can see (shallowly) the difference. TB uses emebedded RDF and PB uses rel and HTTP headers to take care of things. There would be no way to make these two protocols work together, no?

  6. If you are doing trackback autodiscovery, it seems to me that you are doing something like the following:

    1) Extract a list of all the external hyperlinks in the post.
    2) For each external hyperlink, do TB autdiscovery and try to find a corresponding TB URI
    3) Ping each TB URI you’ve found
    4) If the ping succeeds, remove it from the list of URIs to ping and add it to the list of MTPingedURLs
    If it times out, maybe keep it around to try again later.

    Now, since *you* were the one who compiled the list of URIs to ping, you actually *do* know the URI of the corresponding resource (the one you originally scraped to get the TB URI in step 2). You don’t really have to do the ?__mode=rss yoga, if you don’t want to.

  7. yeah you’re right. MTPingedURLs does contain the trackback URIs. I should start reading documentation. Not everything’s as easy to use as my VCR.

Comments are closed.