Docs, features and babbling

12 August 2009 4:13 PM (scheme | irc | irclogs | ruby | imap | maildir | feed2imap)

sbank Tutorial

There's now a tutorial for sbank; this is work-in-progress, but I'd be happy about any suggestions on how to expand it and what to focus on.

New IRClogs features

Also, I've been brushing up my IRClogs webapp recently; it now features:

  • Showing a configurable amount of context around search hits, so you can make more sense of search results without having to go back to the page for that day.

  • Matching phrases in the search results are now highlighted.

  • Each search result entry now links directly to the corresponding day-page entry.

See this link for an example that shows off the features listed above. On the non-user-visible side, there's now support for gzipped logs, which saves a considerable amount of space, just gzip -9 the older log files — this should also work while the IRClogs server is running.

Ruby babbling

I'm using feed2imap to get all those RSS and Atom feeds into my beloved MUA. As I run spam filtering, and split incoming email into Maildir folders on a small server at home (in a setup involving SpamAssassin, Postfix and scmail) and serve those folders over IMAP (using Dovecot), I've decided to add Maildir support to feed2imap, so I no longer have to place my IMAP password in feed2imap's plain-text configuration file.

As feed2imap is implemented in Ruby, this has provided me the opportunity to get my feet wet (or rather moist) in this language. Having a good grip on Python and Scheme, my one-word summary so far would be: Unsurprising!.

If you're interested in the patch, have a watch on the bug report — I'll attach it there once it's in a reasonable shape.

Shiny New Blog

3 July 2009 7:18 PM (meta | scheme | tekuti)

While I had a WordPress-based blog quite some time ago (which I rarely made use of), I was never quite content with it; I wanted something more simple, something that does not need a whole LAMP stack, doesn't require tinkering with mod_rewrite, and ideally has a codebase that I'd want to hack on (which definitely rules out WordPress, which is written in PHP).

Tekuti in R6RS clothing

Well, meet Tekuti. It's a lean blogging engine using Git as storage (so you get hot-backup and versioning for free), and, best of all, it's written in Scheme. Since I already have a Scheme HTTP server running for IRClogs, I decided to hack Tekuti so it could run in the same process; this involved porting Tekuti to R6RS and adding code to interface with the web-server (the original Tekuti only provides its services via the mod_lisp protocol). I must say that working with the Tekuti code was a joy; after getting it running using the mod_lisp protocol under Ikarus and Ypsilon, I could add the HTTP integration without touching the rest of the code at all. Kudos to Andy Wingo for writing this nice piece of code.

Yet another Scheme Web server

To avoid code duplication, I re-factored the ad-hoc libsoup-based web server that drove the IRClogs application into its own library. The interface provided by the library is very much inspired by the SUnet Web Server and hides libsoup entirely.

So, how does my script for running IRClogs and Tekuti inside the SPEnet HTTPd look like? Well, leaving out the customization and library imports, like this:

(define (rforge-request-handler irclogs)
  (alist-path-dispatcher
   `(("blog" . ,(tekuti-handler))
     ("irclogs" . ,(lambda (path request)
                     (irclogs 'dispatch path request))))
   (rooted-file-handler *static-dir*)))

(let ((irclogs (make-irclogs *irclogs-config*)))
   (httpd (make-httpd-options
           with-port *port*
           with-request-handler (rforge-request-handler irclogs))
          (lambda (httpd)
            (irclogs 'update-state)
            (httpd/add-timeout httpd 60 (lambda ()
                                          (irclogs 'update-state)
                                          #t))))))
Running the above code, with *port*, *static-dir* and *irclogs-config* appropriatly defined, will launch a completely stand-alone web server that will serve IRC logs, run a Tekuti blog instance, and provide static content from *static-dir*.

Code

You can fetch the R6RS port of Tekuti via git:

git clone git://gitorious.org/tekuti/tekuti.git
git checkout t/r6rs/do-port