Showing posts with label MetaWeblog API. Show all posts
Showing posts with label MetaWeblog API. Show all posts

Wednesday, May 21, 2008

Using Live Writer to Post Content to a Web Site

I've just added the MetaWeblog API to the Content Management System (CMS) of Suteki Shop. It's most excellent. It means that an administrator can manage the content of the web site using a slick WSYWIG tool like Windows Live Writer. I simply ripped the code for the API from Subtext, a really nice open source blogging application. It took me most of today to get it working, but it'll be a major win for my users who I can't expect to write HTML straight into a web based admin interface.

It's really easy to set up. Simply open up Live Writer and add a new account saying you want to use 'Another weblog service':

1_chooseBlogType

Then enter the URL of the application, here I'm just giving it the URL of the Visual Studio Development Web Server. You also need to enter an admin username (email) and password.

2_HomepageAndLogin

The last step is to tell Live Writer that Suteki Shop uses the Metaweblog API and point it to the XmlRpc endpoint that hosts the API.

3_SelectProvider

After that it's all set up and you can write a post, including images in live writer:

LiveWriterEdit

When you click the 'Publish' button the content magically appears with a new menu item on the Suteki Shop site:

InSutekiShop

You can find my subtext's implementation of the MetaWeblog API the usual place:

http://code.google.com/p/sutekishop/source/checkout

The MetaWeblog API is implemented in the files:

MetaWeblogAPI.cs

MetaWeblog.cs

Note the additional handler in the web.config file:

<add type="Suteki.Shop.XmlRpc.MetaWeblog, Suteki.Shop" path="metablogapi.aspx" verb="*" />