atom-tools’ *NIX tools

atom-tools’ bin directory has several UNIXy tools that I’ve never really mentioned before.

These tools operate on “collections”. I’m using the term in a broader sense than RFC 5023; a “collection” can be an AtomPub Collection, a directory containing Atom Entries, or a feed on stdin or stdout.

atom-cp

atom-cp copies the contents of a source collection to a destination collection.

atom-grep

atom-grep prints a feed to stdout containing all the entries in the source feed that match a given regexp.

atom-purge

atom-purge DELETEs every entry in the given collection.

atom-post

atom-post POSTs the contents of a file or stdin to a given URL.

It doesn’t do anything fancy, it’s just a convenient way of getting media or an Entry created by some other tool onto the web. Eventually this will construct Entries too, but not yet.

Use Cases

Back up your blog:

atom-cp http://example.org/coll ./backup/

Restore a backup, or post several pre-created entries:

atom-cp ./backup/ http://example.org/coll

Delete spam:

atom-grep poker http://example.org/comments | atom-purge -

Plagiarise somebody else’s blog:

atom-grep "popular content" http://example.org/coll | atom-cp - http://example.com/seo

Post a picture to your media collection:

atom-post -m image/png http://example.org/media icon.png

(Disclaimer: XML is a terrible format to pass down a pipe. It’s awfully convenient though, and my pipes and my collections haven’t been long enough for it to be a problem.)

atom-tools, darcs, trac

After far too long, the atom-tools trac is back up.

I’ve moved from bzr to darcs (thanks to tailor), because I’ve been using darcs for everything else. bzr is slow, and cherry-picking is irresistible. The new repository is at http://darcs.necronomicorp.com/atom-tools. Some bugfixes and updates for the almost-final version of AtomPub have been checked in, and a release is forthcoming.

Unfortunately the Trac darcs plugin is a pain to get working. The instructions for installing it as a builtin work, but it’s a bit of a mess.

atom-tools 0.9.0 on its way

The version number’s a bit of a jump, but only because I’d like to hit 1.0 at about the same time the Publishing Protocol makes it to RFC.

No real changelog I’m afraid, but here’s the big stuff:

One of these days I’m going to have to set up Trac.