Converting IRC logs to HTML as simply as possible
Perl
Latest commit dddf6ca Mar 5, 2015 @ap switch to Digest::SHA (core)
Permalink
Failed to load latest commit information.
README.mkd detect CGI environment properly Dec 23, 2010
irclog2html switch to Digest::SHA (core) Mar 5, 2015

README.mkd

This script converts IRC logs in UTF-8 to HTML pages, while attempting to stay as close to no parsing as feasible.

The generated web page contains an anchor for each line so that you can jump to and link to specific lines, and cut-off links to select a particular portion of the log. Links in conversation will also be clickable.

It requires Object::Tiny, Digest::SHA1, Hash::MultiValue, and Perl 5.10 (or newer).

Usage

irclog2html \#foo.1.log \#foo.2.log > channel-foo.log.html

CGI mode

If the script detects that it was run in a CGI environment, it will look at the PATH_TRANSLATED environment variable for the filename to read. The assumption is that the script will be run by the web server to handle requests against particular files.

Put it somewhere for your web server to find, eg.:

ln -s `which irclog2html` /var/www/cgi-bin/irclog2html.cgi

Then add something like the following lines to .htaccess or to your Apache configuration:

AddCharset utf-8         .irclog
AddType    text/x-irclog .irclog
Action     text/x-irclog /cgi-bin/irclog2html.cgi

After that, any file with the extension .irclog in your web server’s document root will automatically be rendered as an IRC log.