I've been keeping this blog since the beginning of the year, and it's
gradually been accreting ancillary code.
chronicle itself
is a blog-orientated template engine plus a comment submission system;
I feed it posts written in markdown (textile and HTML are also
available, though sadly not org-mode which I'm
using for most of my structured writing these days), and it formats
them into static HTML (plus RSS) and integrates the comments. It's the
sort of software I like: it does one job well. But of course I've now
written other bits of software that work with it.
The first was a very simple one: a wrapper script, because I found the
pre-build and post-build commands a bit too blunt. Because I prepare
posts on a machine at home and then send them up to the public-facing
server, this one will bring down any new comments, run the rebuild if
necessary, make sure all files are world-readable, and sync them to
the server.
The second augmentation was a comment processor: it pulls in any new
comments, and classifies them into "good" (using a known email address
or coming from a known IP address; not a known username, for obvious
reasons), "spam" (containing distinctly spammish words or phrases), or
"unknown" (everything else, which might be a new commenter but is
probably spam). I could probably use an existing processor such as
crm114, and may eventually do so, but I couldn't be bothered in this
early phase. The "good" comment directory then gets used by chronicle
itself to rebuild the site. (I can manually move comments around
between the three categories, of course.) Yeah, I get spam; it
probably makes up more than half the total comment submissions here.
But because there's no automatic publishing, the spam never makes it
to where the audience can read it.
(Incidentally, the Doctor Who series 2 post gets about as much spam as
everything else put together, and my review of Mrs Miniver gets the
second most spam. Anyone have any idea why that might be?)
The third augmentation decides what to publish next. Each post has a
primary category: aeronautics, book, film, etc. This script works out
a score for each category: the number of days since the most recent
occasion when an article in that category was posted, plus 0.9 × the
number of unposted articles in that category (to reduce the weight of
that term slightly, and to break ties). The category with the highest
score is the one that gets that day's post. Of course it's a little
more complicated than that, because I can also cue posts to go up on a
specific date (e.g. for bookmonth posts, themselves more or less
automatically generated, or when I've been doing something the
previous day and want it to be posted straight away).
At some point I'll probably shift most of this onto the server so that
daily posts don't rely on the machines at home continuing to run.
I have never read other bloggers writing about tools like this.
WordPress lets you hide posts until a specific date, but you still
have to set that date manually (which is what I was doing here at
first, and Chronicle comes with a tool for that). Various platforms
talk about their wonderful editing features (woo, autosave while
editing), but really, guys, I already have emacs with markdown-mode;
why would I want to use some jumped-up TEXTAREA instead of that?
Oh, free tip. If you are trying to get chronicle set up, be aware that
specifying a config file on the command line does not prevent the
system from also reading /etc/chroniclerc or ~/.chroniclerc files.
Which may, as in the case of debian, contain
no-comments = 1
which could be a bit of a pain if you're wondering why your commenting
engine isn't being enabled.
Comments on this post are now closed. If you have particular grounds for adding a late comment, comment on a more recent post quoting the URL of this one.