« Roller 1.0 is availa... | Main | Guess I'm not gonna... »

BlogClient 1.0 is available

BlogClient is an experimental blog client library designed to make it easy to write Java programs that blog. It supports both Atom and XML-RPC based protocols. I wrote BlogClient for the new Manning book Blogs, Wikis, and Feeds In Action, which is due for release this Spring. I'm not quite done but I am ready to get some feedback, so please download BlogClient, try it out in your own programs (or try the test GUI), and let me know how I can make it better.

How does it work?


The idea is to define a couple of simple interfaces for the objects we need to blog, such as a BlogClient, BlogSite, and BlogEntry. Then, provide implementations of those interfaces for the different protocols. The diagram below shows the interfaces and classes that make up the Blog Client API. Right now, I have two implementations of the interfaces. I have an AtomBlogClient, that is based on the Atom protocol and a MetaWeblogApiClient that is based on a combination of the MetaWeblog and Blogger APIs.

Diagram of Blog Client interfaces

Using Blog Client

Assuming that you have the BlogClient jars in your classpath, using the BlogClient to make a post to your blog via the MetaWeblog API works like this:
    BlogClient client = new MetaWeblogApiClient(
"http://jroller.com/xmlrpc", "scott", "tiger");
String[] sites = client.getUserBlogs();
BlogSite site = client.getBlogSite(sites[0]);

BlogEntry entry = site.createEntry();
BlogEntry.Content content = new BlogEntry.Content("Hello blog world!")
entry.setContent(content);
entry.save(true);
As you can see, some improvements could be made in API usability. Let me know how you'd like to see the API work. Oh, and those jars I mentioned:

rome-0.5.jar (modified to support link titles and rel="resource.post")
xmlrpc-1.2-b1.jar
commons-httpclient-2.0.2.jar
jdom.jar
commons-codec-1.1.jar
commons-lang-2.0.jar
commons-logging.jar

Where to learn more

You can find the complete BlogClient API interfaces on the Roller wiki and you can download version 1.0 of the client library here: blogclient-1.0.tar.gz. Also, included in the client library is a Swing-based GUI that supports creating, editing, and deleting blog entries as well as uploading images. Here 's a screenshot:
BlogClient GUI
And here are a couple more:
Login | Editor view | Entries view


Status of BlogClient

BlogClient is not complete because Atom itself is not complete. Work remains to bring BlogClient in-line with the current Atom protocol and format specifications. BlogClient been tested against the important blog servers -- by which I mean, of course, Blojsom, Pebble, Roller, and a couple of others. The table below shows the testing that has been done so far.


New
Entry
Edit
Entry
Delete
Entry
Get
Entries
New
Resource
Get
Categories
Set
Category
Roller 1.1 XML-RPC X
X
X
X
X
X
X
Roller 1.1 Atom X
X
X
X
X
**
**
Blojsom XML-RPC X
X
X
X?
X
X
fail
Blojsom Atom X
X
X
X
fail
**
**
Pebble XML-RPC X*
X*
fail
X
fail
X
X
Movable Type XML-RPC X
X
X
X*
fail
***
***
Das Blog XML-RPC








? Can't tell what expected behavior should be
* Operation succeeds but exception is thrown

** Atom does not support categories yet
*** Movable Type does not implement categories via MetaWeblog API

Plans for Blog Client

I'm releasing BlogClient as open source now to get feedback and I'll be improving it over the next month or so. Once the book goes to print, I'll try to find it a nice home (most likely as a Rome sub-project).

Enjoy!
Comments:

go Dave. that is interesting news. i look forward to seeing the flowers bloom

Posted by 84.9.96.179 on January 17, 2005 at 04:59 PM EST #

Dave, I just tested BlogClient against Pebble 1.6.1 and although there was a small problem with uploading files, the new/edit/delete calls seem to work fine. Do you remember what the problems were?

Posted by Simon Brown on January 17, 2005 at 07:15 PM EST #

Looks good dave, but could: String[] sites = client.getUserBlogs(); become List sites = client.getUserBlogs(); // list contains actual BlogSite instances?

Posted by Michael Koziarski on January 17, 2005 at 09:38 PM EST #

Cool package. What version of the Atom spec does it support?

Posted by Brad Neuberg on February 09, 2005 at 04:57 PM EST #

Is there any development happening on the client? It would be nice to make it a OS project.

Posted by 24.6.64.237 on May 23, 2005 at 01:57 AM EDT #

I'm using your BlogClientLibrary found on [1] in a small own Blog Client, which I write to learn and work with java. (understanding your code and using it in a self-written GUI) Thank you for this code! 2 things:
I found that you use for the blogger.com a private key in MetaWeblogClient.java. According to [2] they no longer require a key.
On [1] the link to the blogclient tar.gz is broken. Have you found a new "home" for your blogclient?
Andi
[1] http://rollerweblogger.org/page/roller/20050117
[2] http://www.blogger.com/developers/api/1_docs/register.html

Posted by Andreas Hauff on June 12, 2005 at 10:58 AM EDT #

Can anybody send me a copy of BlogClientLibrary?since that the link of the tarball is broken. Thanks.

Posted by Ray Chen on July 09, 2005 at 06:08 AM EDT #

hey Dave, The link in the post is broken. Is there some way I can get the code now? thanks, Abhaya

Posted by 59.144.47.70 on July 25, 2005 at 03:17 PM EDT #

Hi David, i am also interested in obraining the BlogClientLibrary .. is it still available somewhere for download .. Cheers, Maya

Posted by Maya on July 30, 2005 at 11:29 AM EDT #

Is there any alternative to this blog client in 2010 :-) ? It would be very handy for me right now, Thanks

Posted by Joseph on May 06, 2010 at 08:56 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed

« Roller 1.0 is availa... | Main | Guess I'm not gonna... »

Welcome

This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category Blogging, some may be related to this entry.