Trackback vs MetaWeblog API

When I implemented Trackback support here, one snag I ran up against is that I typically post to my website via the MetaWeblog API (using the very cool w.Bloggar client app), and the blog posting APIs don’t provide any inherent way to provide Trackback URLs. Nor should they, as that doesn’t really fall under the API’s core functionality. However, it still seemed wasteful to have to set up a separate web form just for doing Trackbacks. So here’s what I did….

In the server code that handles the client APIs for my blogging software, I added a snippet of code just after where a new entry is actually posted into my blog. The code snippet searches the incoming blog entry for an HTML comment that looks like:


<!-- trackback url=http://www.example.com/tb.cgi/987 -->

If it sees comment like that, the code extracts the Trackback URL and posts a Trackback ping to it. Voila! A tiny amount of work, and now I can go back to being moderately lazy. All I have to do is remember to put the Trackback URL in an appropriately formatted comment, and my server will automagically let the site know that I’ve linked to them.

I’d like to encourage anyone else involved in coding other blogging systems to do the same, if your software supports one of the blogging APIs (BloggerAPI, MetaWeblog API, etc) and Trackbacks.

Trackback vs MetaWeblog API
This entry was posted in Uncategorized and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • Digging Into WordPress Book

10 Comments

  1. Posted January 3, 2003 at 2:06 am | Permalink

    Here’s a method I proposed, that is much easier for the user since it’s totally transparent.

    Once the client app has posted an entry, it’s receiving a post ID (according to the Blogger API). Make a new method myblog.getPermalinkFromID, let the client app use it to get the permalink of the newly created entry.
    From here on, the client app can do the trackback/pingback work itself just fine.
    (For the Trackback work, I assume the client can do trackback autodiscovery, which has a very poor design and therefore may slow down the app more than Pingback would… but that’s not the topic here.)

  2. Posted January 3, 2003 at 6:03 am | Permalink

    I haven’t implemented Trackback autodiscovery, yet. So I was looking for an interim solution that would be nice and generic.

    I’m working on Pingback support now, and since it uses autodiscovery as a core part of the spec, I should be able to carry over some of what I learn there back into my Trackback code.

  3. Posted January 3, 2003 at 10:16 am | Permalink

    I assume you are setting up a way to ping the site to which your blog entry refers. If so, you probably also want to send other cool info in the ping like the URL of your entry (this is required, right?), the title of your post, and excerpt of the post, and the title of your blog. How are you doing this now? does your internal API grep this info from your post and then pass it with the ping?

  4. Posted January 3, 2003 at 10:26 am | Permalink

    When I post via the MetaWeblog API, all of that information is available. The client program sends the post’s title and content. When the post is saved into the database, the post’s ID is returned, and I can build the permalink from that. So I’ve got all of the essential info to send in the Trackback ping.

  5. Posted January 3, 2003 at 10:45 am | Permalink

    So your comment entry is a way to instruct your server API to compose a valid message to ping the URL in the comment, right?

    how about changing the comment format slightly to set it apart from any other comments that might look like a trackback?

    something like <!–%%trackBackUrl=”…”–>

  6. Posted January 3, 2003 at 10:58 am | Permalink

    Yes, the comment just gives me a way to supply the Trackback URL, since the client program doesn’t have a dedicated way to enter it.

    Why would I need to change the format? As it is, I never include any HTML comments in a post for any other purposes. And the format I’m currently using is very specific, so it’s unlikely that I’d forget and trigger it accidentally.

  7. Posted January 3, 2003 at 1:36 pm | Permalink

    just thought that, if you wanted to do it in a way that would encourage others to also implement the same kind of feature, that using a more unique pattern for the comment wrapper would make it easier for other tools to deal with the item. If the idea is really just a way to make your own back end work, then it doesn’t matter at all.

  8. Posted January 3, 2003 at 1:36 pm | Permalink

    just thought that, if you wanted to do it in a way that would encourage others to also implement the same kind of feature, that using a more unique pattern for the comment wrapper would make it easier for other tools to deal with the item. If the idea is really just a way to make your own back end work, then it doesn’t matter at all.

  9. Posted January 7, 2003 at 12:50 pm | Permalink

    This is a good idea. However, I’d like to see the blogging applications (w.bloggar and the like) support trackback/pingback natively. This can be done so many different ways, all of which are fine with me. The client can visit the links in the post looking for TrackBack auto-discovery and pinging them (or asking the user if it should do so) as needed. Additionally, a trackback field in the client could handle this for those that don’t support auto-discovery. I agree with you, however, that the metaweblogAPI should not be changed to support this. It just doesn’t fit.

  10. Posted January 7, 2003 at 1:15 pm | Permalink

    I’d certainly be happy with a client-based solution, as well. w.Bloggar already has native support for pinging weblogs.com, so Pingback and such probably wouldn’t be that much more to add.

One Trackback

  1. By Pizza Review on March 14, 2006 at 3:19 am

    Pizza Review Blog…

    Pizza Review…

Post a Comment

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting