Monday, May 26, 2008

What is RSD? Making my Suteki Shop to Live Writer integration slicker.

I recently wrote about how nice it is to use the MetaWeblog API to allow tools like Live Writer update content on bespoke software like my Suteki Shop eCommerce application (which is now morphing into a generic CMS). The one thing I didn't like was the step that requires the user to enter the API their site exposes and it's endpoint:

3_SelectProvider

A little more digging around the Live Writer docs and various blogs led me to discover Really Simple Discovery (RSD). It's an XML schema for describing the APIs that your software exposes by Daniel Berlinger.

In the head of your homepage you have a link to the location of your rsd.xml file:

<link title="RSD" href="http://localhost:63638/rsd.xml" type="application/rsd+xml" rel="EditURI" />

And here's the file itself:

<?xml version="1.0" encoding="utf-8" ?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd" >
 <service>
   <engineName>SutekiShop</engineName>
   <engineLink>http://sutekishop.co.uk/</engineLink>
   <homePageLink>http://localhost:63638/home</homePageLink>
   <apis>
     <api name="MetaWeblog" preferred="true" apiLink="http://localhost:63638/metablogapi.aspx" blogID="1" />
   </apis>
 </service>
</rsd>

As you can see it simply contains the web site engine name (suteki shop), the URL of the engine's homepage and the URL of this instance's homepage. Then follows a list of APIs that the engine supports. In my case it's a single entry for MetaWeblog that shows the XML RPC endpoint.

In the case of Suteki Shop, since it's an MVC Framework based application the rsd.xml file itself is generated from a view that simply inserts the current application URL where, in this case, "http://localhost:63638" appears.

No comments: