WLW+AtomPub, Part 1: Autodiscovery
When things are working properly, Windows Live Writer only requires the user to know three pieces of information to configure a blog: the blog homepage URL, the username, and the password. Even the most novice bloggers should be able to answer those questions, and there’s no technical reason why we should ask more of anyone.
Of course, to actually post to a blog, we also need to know what blogging APIs are supported and where the endpoints are. For MetaWeblog-based protocols, the standard protocol for “autodiscovering” that information from the homepage is RSD.
Configuring an AtomPub blog needs to be equally easy. For some reason, people in the AtomPub community don’t seem to like RSD (only Six Apart puts Atom endpoints in RSD). We need another autodiscovery mechanism.
Update Oct 16 2007, 8:42 AM: Sam Ruby and then Daniel Berlinger [inventor of RSD] have weighed in. Sam created a patch that adds Atom to WordPress’s RSD. Hmmm, maybe we didn’t need another autodiscovery mechanism after all. In fact, RSD nicely solves the “class=preferred” problem below.
Not to pick at old wounds, but here’s the thread that made me think RSD wasn’t going to fly with the Atom community. I forgot the specifics last night and was too lazy to go hunt the thread down.
Add a link to your service doc
There’s no official IETF standard for AtomPub autodiscovery, but there seems to be rough consensus among implementers that a link to the service document should be included in the <head>:
<link rel=”service” type=”application/atomsvc+xml” href=”…” />
(Please pretend the curly quotes are straight quotes; WordPress does that automatically.)
AtomPub or MetaWeblog?
If your blog homepage has both RSD and a service doc link in the <head>, Windows Live Writer will generally take the RSD (in other words, it will use AtomPub only if a MetaWeblog-based protocol isn’t available). There are two separate ways to force Writer to prefer AtomPub instead.
- Add the attribute class=”preferred” to the AtomPub service link element. (If your server actually does speak AtomPub better than MetaWeblog, this is what you should do.)
- Start WindowsLiveWriter.exe with the command line argument /preferatom. (This is intended to make testing convenient for server implementers.)
Note that these only have an effect at configuration time–that is, only when you are adding a new blog or updating the configuration of an existing blog (Weblog | Edit Weblog Settings | Update Account Configuration).
While you’re at it, you might consider also adding a link for the collection feed URI, and on permalink pages, a link for the entry’s edit URI. In earlier drafts of the AtomPub spec, they look like the following, respectively:
<link rel=”service.post” type=”application/atom+xml” title=”…” href=”…” />
<link rel=”service.edit” type=”application/atom+xml;type=entry” title=”…” href=”…” />
The next version of Writer won’t look for these links, but it’s easy to imagine features we could add in the future if they were available. Then again, since these were pulled from RFC5023 and don’t appear in any other spec, there may be some valid disadvantages to this approach that I’m not aware of. Any standardistas out there want to chime in?
Filed under: Atom, Windows Live Writer | 11 Comments