About Archive Tags RSS Feed

 

Children Of The Dammed

13 December 2007 21:50

After a lot of hacking I've now got chronicle displaying comments upon entries.

Since my blog is compiled on my home desktop machine and comment submission happens upon a remote machine the process involves a bit of a hack:

Publish Blog

The blog is compiled and uploaded to the live location using rsync.

Wait For Comments

Once the blog is live there are embedded forms which may be used to receive comments.

The CGI script which is the target of the forms will then write each comment out to a text file, located outside the HTTP-root.

Sync Them

Prior to rebuilding the blog the next time I update I rsync the comments directory to my local machine - such that the comments posted are included in the output

This my local tree looks something like this:

~/blog/
|-- comments/
|-- data/
|-- output/
|-- Makefile
`-- chroniclerc

Here I have a Makefile to automate the import of the comments from the live site to the local comments/ directory, rebuild, and finally upload.

All this means that I can rebuild a blog created by a combination of plain text post files and plain text comment files.

It also means that there is a fair lag between comment submission and publication - though I guess there is nothing stopping me from auto-rebuilding and syncing every hour or two via cron...

I'll make a new release with this comment.cgi script and changes once the package hits Debian unstable...

| 4 comments

 

Comments on this entry

icon Joey Hess at 18:31 on 13 December 2007

I've hesitated to say this about chronicle before, but I really hope you know about ikiwiki, and are not using it for some good reason. Since it can do all of the above much more sanely. ;-)

(Example of how I do it with ikiwiki: http://ikiwiki.info/tips/laptop_wiki_with_git/)

icon Steve Kemp at 20:06 on 13 December 2007

Thanks Joey, and no worries about the comment / pimping!

Yes I know about ikiwiki, and have experimented with it in the past.

At the time I needed simple blogs it seemed to me simplest to use nanoblogger, or other simpler "compilation" systems. Partly because the "posts" weren't under revision control - and if they were they would have been used with CVS.

Right now I migrated because of load issues with ruby, as previously explained, and had I not had this tool already to hand I would have probably used ikiwiki - albeit with the feeling that it was probably overkill.

It just so happened that the software was here, and it works well enough for my needs that I installed it.

I could handle the complexity of the comment passing easily enough - just by moving the blog source files to the remote webserver rather than my desktop machine. That makes it trivial to auto-rebuild upon submission. (Although I'd probably want some simple anti-spam in there before I did that).

Anyway if my needs change, or this solution doesn't work out I'll rexamine ikiwiki next. I know that nanoblogger/bashblogger don't scale well enough already ..

icon Saint Aardvark at 20:33 on 13 December 2007

Interesting approach to comments. When I was hacking together a similar (plain text + markup -> html) setup for my own blog, one of my motivations was avoiding comment spam. There were lots of plugins for Wordpress, but they all seemed to have their own problems: they didn't work, or they depended on outside services (which I don't like on principle), or they'd randomly block ham from IP addresses they thought were spammy. And I hate CAPTCHAs.

I kept thinking about greylisting for email, and how well that's worked for my (small volume of) email...so I decided to use that.

When I create a blog entry, a script appends a "submit a comment here" HREF that is comments+[datestamp]@my domain. I pipe comments to an ugly Perl script that figures out which entry it should be appended to, and then I recompile.

The good side is that it takes advantage of greylisting and SpamAssassin, which (for me) have nearly solved my email spam problem. I don't think I've seen any spammy comments show up in my mailbox, so there's no manual filtering to do, or vetting of a plugin's choice to mark something as spammy. In theory, I could approve comments by just forwarding them to another address (possibly signed with GPG), and have it work automatically.

The bad side is that it's very different from the way nearly every other blog works, and I suspect that irritates people enough to not bother leaving comments. OTOH, I never got that many comments to start with. :-)

icon Steve Kemp at 20:40 on 13 December 2007

Actually I think your idea of using mail is probably more interesting and novel than mine!

I think it sounds great, although I do guess that people wouldn't like to use email for comments so much. I know that I rarely use mail from my "surfing machine" where I actually read blogs..