ilbot - an IRC Log Bot
On #perl6 we had the need for
a irc log that could easily be accessed with a web interface. So I wrote
one.
It consists of an IRC bot based on Bot::Basicbot
that logs into a (mysql) database, and a web frontend that displays the
data nicely.
Features
Links
URLs are turned into links.
More importantly for the logging of #perl6, there are special
constructs that are turned into links:
- An 'r', followed by a number (for example r12345) is turned into a
link to the corresponding changeset of pugs' subversion
repository
- Something of the Form S05:123 (S\d\d:\d+) is turned into a link to
the Perl 6 Synposis documents,
pointing to the right Synopsis including line number.
- Abbreviations used in logs are annotated according to a plain text
database.
Privacy
If you want to write something in a channel that is logged by ilbot,
and don't want that line to be logged, prepend it with the string
[off].
An @ sign proceeded and followed by letters and numbers are turned
into a small image showing an @ sign to prevent email adresses from
beeing maschine readable.
Layout
Just take a look at the
#perl6 irc log to get
an idea how the generated logs look like.
Download
The source code lives in the pugs repository:
svn co http://svn.pugscode.org/pugs/misc/irclog/
Installation
To install these scripts on your system you need to
- Create a database, you can use ilbot.sql for that if you use
MySQL
- Install all dependencies, among them are
- Config::File
- CGI
- DBI
- Net::IRC
- CGI::Carp
- Encode::Guess
- HTML::Entities
- HTML::Template
- File::Slurp
- Regexp::Common
- HTML::Calendar::Simple
- Modify all config files, hopefully they are self-explanatory.
- Copy (or link) the files of the cgi/ directory to where your
webserver can find them, and edit the
colors hash to fit
your needs.
- Be sure to password-protect the file spam.pl with a
.htaccess file.
- Edit cgi/footer.tmpl and insert your name and Homepage in the
"Provided by..." sentence, and add your contact details (and delete mine,
please).
Perhaps a more detailed description will follow.
Spam filtering
To manually delete spam from the IRC logs, you need to do the
following:
- On the page that contains the spam, append
;admin=1 to the URL.
- You'll see two columns of checkboxes on the left. In the left
column, you can mark two checkboxes, denoting the beginning and
end of a range of spam lines. In the right column you can mark
single lines as spam.
- Once you hit the "mark as spam"-button, you'll be asked for
your password (provided you configured your .htaccess file
correctly). If your authentication succeeds, the selected
lines will be marked as spam and disappear from the logs. Note
that they are not deleted and can be restored by modifying the
database directly.