Contains coding, but not narcotic.

Rump gets more CRUDdy

July 10th, 2010 1:22:32 pm pst by Sterling Camden

Since the MetaWebLog API provides “getPost”, “editPost”, and sometimes “deletePost” methods, I’ve added corresponding operations to rump (my text-editor-oriented blogging tool) via three new command-line switches:

-u ID

Updates the post identified by ID. This overrides the default operation of adding a new post. It has no effect if -p (preview), -f (fetch), or -d (delete) are also specified.

-d ID

Deletes the post identified by ID. This overrides the default operation of adding a new post, or any -u switch. It has no effect if -p (preview) or -f (fetch) are also specified. Since deletePost is not included in the MetaWebLog API specification, you’ll have to see whether your blogging framework provides it. WordPress does.

-f ID

Fetches the post identified by ID. This overrides the default operation of adding a new post, or any -u or -d switch. It has no effect if -p (preview) is specified.

When fetching, replacements are performed on the resulting post, which is then sent to $stdout in rump source format. That allows you to edit it and then resubmit it either as an update to the original or as a new post.

This opens up a number of new possible uses for rump. You could use it to backup your blog to rump files. You could retrieve and edit posts in vim (or your preferred text editor, as long as it can read/write pipes) without ever saving them to a local file. You could construct a fetch/update pipe in a loop to perform mass edits. Your blog is now entirely pipable.

download

BitBucket repository

Posted in Ruby, Web | 1 Comment » RSS 2.0

One Response to “Rump gets more CRUDdy”

  1. [...] Rump gets more CRUDdy — Chip’s Tips for Developers… and doesn't everyone want a CRUDdier rump?Tags: chipstips ruby rump blogging [...]

Leave a Reply