Home Poor Blog APIs
Post

Poor Blog APIs

When it came to choosing blog software for my personal web site, I first considered writing my own. After all, it can’t be difficult, can it? And I have written my own software for my web site including the photo albums, all based on the Orbeon PresentationServer (OPS) platform. But I let laziness prevail and figured that existing software must be good enough, and I settled for Roller. I preferred a Java-based solution since my OPS-based software already runs on Java and Tomcat.

But finally a few days ago, I launched a mini-project to create a new “Blog” sample application for OPS. So this weekend, I spent a few hours getting started with this. My approach was that the best thing to do first would be to look at blog APIs, such as the Blogger API and the MetaWeblog API. The MetaWeblog API extends upon the Blogger API, offering some added functionality, and refining some existing functionality (by replacing calls). A few things struck me:

  • Both those specifications are poorly written. I have nothing against Dave Winer, mind you. But consider something like this: “In getPost, the returned value is a struct, as with the Blogger API, but it contains extra elements corresponding to the struct passed to newPost and editPost.” This is it. This is how getPost is “specified”. There is not even an example showing what the result looks like. No XML Schema or Relax NG schema normalizing what the structure must adhere to. The good news is that you can figure it out, after all, but the bad news is that there is room for misunderstanding. A little more formalism would help.
  • The APIs are extremely basic. This would not be bad per se, on the contrary. But here simplicity almost equates indigence. There is no access to post comments, for example. There is a call to create a new “media object”, but then nothing to list existing objects, retrieve them, or update them. There is no way to manage blogrolls.
  • The APIs are based on XML-RPC. It would be so much easier to just send and receive structured documents! The calls would be so much shorter and so easier to understand. Well yes, XML-RPC is relatively appropriate for mapping to function or method calls. But that comes at the cost of creating XML documents that are overly complex. I for one much prefer document-based services. See my other blog entry for an example. I am not the only one to have realized that, obviously: see Why We Need Echo, What’s Wrong with the MetaWeblog API, and the Atom Project.
  • The APIs don’t leverage HTTP. Authentication is not built into XML-RPC. Simple HTTP authentication would work in theory, but there, the authors of the two APIs in question have resolved to embed username and password information into every request. Therefore, your application has to handle authentication itself, rather than, say, using the existing mechanisms set in place by your web or application server. This is extra burden for the implementor of the APIs.

As of today, I have been mainly been using w.bloggar to edit and post blog entries. It supports the Blogger API and the MetaWeblog API. So for now, in spite of their limitations, I have stuck to implementing those APIs. In fact, in just a few hours, I have implemented a good part of them without great difficulty (thanks OPS - I know, this is so self-serving), but with no way of knowing that I am actually implementing them correctly, other than by observing w.bloggar’s behavior.