P@ Sunglasses

« Moblogging in Atom:... | Main | eleven words infant... »

20040929 e mërkurë shtator 29, 2004

Using desktop blogging client

Weblog servers often provide a user interface to post to your weblog, aften a textarea where you type in your text, a combobox to select a category, and a post button. In the best user interfaces, when you have a decently recent browser they provide you with a rich text editor around the textarea, for WYSIWYG editing of your post. But over the years servers have exposed remote APIs that let a client, be it a desktop application, a cell phone or a backend system agent, post to a weblog.

The problem is that most people don't know how to configure these clients when they find one. In this article I will explain how to configure a desktop client to post to a MetaWeblog API server such as Roller, using blogs.sun.com as an example.

Using a blogging client with Roller, on the Roller user's guide wiki does a good job at explaining how to configure a MetaWeblog API desktop client to post to Roller.

It uses w:bloggar, a Windows client, which seems to have many features. Unfortunately as explained in A quick history of the weblog posting APIs, MetaWeblog API based clients, and servers, vary in quality of implementation, depth of configuration they offer, and the wiki documentation doesn't make clear what is the minimum set of common attributes that you need to set in most of these clients. Moreover the "spec" is not as rigorous as W3C, OASIS or IETF specs, and clients and servers often implement it incompletely or interpret it differently.

For example Tektonica MO:BLOG which I use on my Treo phone does implement the metaWeblog.newMediaObject (blogid, username, password, struct) entry point, but does not send the Mime type of the object. Roller 0.9.8.2 which we use now does not implement the newMediaObject method at all (throw new XmlRpcException(UNSUPPORTED_EXCEPTION, UNSUPPORTED_EXCEPTION_MSG);). The code for MetaWeblog API implementation in Roller is borrowed from David Czarnecki's code for the same thing in Blojsom. But Roller used an old version of Blojsom: the current Blojsom implements it correctly. Too correctly for MO:BLOG, so I had to hack and recompile that blojsom class on my server in order to be able to post pictures from my Treo:-(

I don't mind that kind of fooling around with clients and servers. Moreover in order to configure a client, having played with many clients and servers over the past few years, I quickly found out what I needed on the wiki page to configure NetNewsWire, Ecto, and Tektonica MO:BLOG to post to Roller on blogs.sun.com. But I understand that it is not clear to many of my Sun colleagues who have started blogging since a few months. David Ogren, who has an interesting blog here just asked the question in the sun bloggers list, so I'll try to answer here: How to configure a desktop blog posting client to post to Roller on blogs.sun.com

I will restrict myself to MetaWeblog API based clients for now, until John, Dave and Will install the latest Roller on blogs.sun.com and we can dump this API to finally use Atom.

Please read A quick history of the weblog posting APIs first in order to get some context (I try to slowly build a knowledge base here, post by post:-)).

Looking at the MetaWeblog API specification, you can see that all calls have 4 elements in common: blogid, username, password and a struct (looks Cish isn't it?-). The struct is specific to each call, but the 3 other parameters are what you need to minimally provide to your client. Username and password are self explanatory. Blogid is there because on many systems, such as MovableType, you can have many different weblogs for a single user. In Roller userid and blogid are the same. If you want another weblog just create another user. Then because the MetaWeblog API specification is an XML-RPC API, you need a url to post your call to.

To summarize, all MetaWeblog API based clients will ask you for 4 pieces of information: username, password, blogid, xmlrpc url. In Roller, and more specifically on blogs.sun.com these will be:

All the rest is details. Some weblog clients propose you a list of server types, in order to customize the parameters they will ask of you. This lets them take advantage of certain specific server features (MovableType, which invented many specifications and features for blogging, has many of these). Roller is rarely in the list. Then just choose MetaWeblog API compatible in the list and it should work fine.

When using NetNewsWire Pro 1.07 not all features worked well all the time: as I explained servers and clients often differ in how they interpret the specifications, and don't all have perfect error reporting. I remember having had trouble with getting categories, or old posts. I hope Marsedit will have fixed that.

I've used these guidelines for NetNewsWire Pro 1.07 that I used until yesterday, Ecto, MO:BLOG, and Marsedit Beta 1.0 / NetNewsWire 2.0b3 beta that I use since yesterday and find fantastic! This is actually my first post using Marsedit, using the configuration I described above. The editor is really very nice: easy tag list to add classic HTML tags, custom list to add your own, shift-apple-A with a selected text to add a href with the string currently in the clipboard. And it got my previous posts and categories from the server without a hitch. Let's see if posting works...!

Oooops, no, error message, "the server did not respond". Let's try again.... same thing. Marsedit has a nice XML-RPC console, let's try to troubleshoot what happened:

XML-RPC reply received: 2004-09-29 17:29:07 +0200
URL: http://blogs.sun.com/roller/xmlrpc
Method name: metaWeblog.newPost
Status code: -1
Succeeded: NO
--Download Error--
Response text:

OK so Marsedit does not seem to work as well as NetNewsWire 1.07 with Roller 0.9.8.2. I edit this in the Roller UI. What happened is that I tried to post 4 times and got the same error message. But then a few minutes later I realized my posts had been taken into account in the server! So I had 4 duplicates of the same post. Dave Johnson says in an internal email that he is using Marsedit with Roller 0.9.9 and it works fine. Blogs.sun.com should migrate to 0.9.9 soon, so hopefully Marsedit will work better then. In the meantime, either use Ecto or NetNewsWire 1.0.7... or your cell phone! The instructions above are valide for any MetaWeblog API client.

This shows how immature weblog posting software is today: the Atom API specification should make client and servers more interoperable.

Coming next week are posts about Moblogging from a cell phone, and the Atom API: stayed tuned!

( Sht 29 2004, 08:37:45 PD PDT ) Permalink Chat about it Technorati cosmos Tagsurf It

Comments:

Post a Comment:

Comments are closed for this entry.

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.