BClient: an editor-independent method of talking to your weblog.
BClient is a command-line interface to the XML-RPC features of many weblog engines. Currently it allows you to fetch the latest X posts, fetch a specific post, post to your weblog, or post an edit to an existing weblog entry.
The advantages of this are fairly widespread; have you ever wanted to use vim or emacs instead of some crappy gui client with half the features your tough, hardened programmer's editor has? Install the macros (or write your own) to use bclient directly in your editor.
Have you ever wanted to move to new blog software but find yourself digging for or writing a conversion program to convert from niche blog software a to niche blog software b? Instead of doing that, find or write an “Action” interface (see BClient::Action, it's simple) for both systems, and let bclient do the rest. Since it can properly handle the gathering of your posts and the re-posting of them, the operation is reduced to a simple shell `for` loop.
Usage is fairly simple:
Create a (very simple) XML file containing your blog post (see below)
Provide it on the standard input to bclient with the -P (post) or -E (edit) flag. There are other options that may be applicable to your situation.
There also macros for vim that you can install
To get at your posts:
use the -L NUM switch to the get the last NUM posts, or the -G POSTID option to get a specific post.
Watch it appear on your standard output! There are different ways of displaying the data, check the options. (Note: you will need to fetch the XML representation of the post to edit it and post it back to your weblog.)
Configuration is done in YAML format. For example:
url: http://myblog.example.com/path/to/xmlrpc.php login: corky_doctorow password: ilikemonkeys
This configuration is supplied as an argument to bclient, allowing you to provide as many configurations as you have weblogs.
The post format heavily relies on how your weblog handles the XML-RPC packet handed to it. Therefore, many pieces of metadata will be weblog specific (e.g., taxonomy handling, multi-user support).
However, since the vast majority of weblogs support the metaWeblog or Blogger APIs, you can almost guarantee this will get your content posted:
<post> <title>My Weblog Entry</title> <description> I took a poop today, it felt pretty good. I wish I hadn't eaten so much corn, however. </description> </post>
Post XML documents must have the “<post>” tag as their root document tag.
If you wish to post an edit, this is also very simple. Just provide a <postid> tag with an integer which corresponds to the post you're trying to edit. Example:
<post> <postid>42</postid> <title>I discovered the secret of the universe!</title> <description> <span style="color: white; background-color: white;">It's bacon!</span> </description> </post>
Formatting your description:
The description tag is a little weird, and is a work in progress. For now, understand that it will intentionally remove linefeeds in content it detects as a paragraph, and it does this to help the weblog engine display your content as you intended. In planning is a selection of input formatters similar to the display formatters (see –help) which will allow you to provide hints to bclient on how to reformat your post before sending it to the weblog engine.
Please see the COPYING.rdoc file for information on copyright.
bclient is written and maintained by Erik Hollensbe <firstname.lastname@example.org>. If you like it, send him an email.