Authenticated as: Anonymous (Change Credentials / Create Account)

The IRC Oracle

Like many great (*snort*) ideas, the "IRC Oracle" started as a simple programming exercize to get the hang of a new API - namely MySQL. Or was it sockets. I forget. Anyway, I found it kind of neat, simple yet remarkably effective if you knew how to populate the database, and I used it for a bit.

Fast forward a few months. I didn't feel like doing anything with the code, and it wouldn't stay running for more than a couple of days. This code is tragically neglected, so suffice to say it's not stable or production quality in any way.

umm.. so what's it do?

Basically, it's a robot that sits in an IRC channel and watches. When addressed (I like my bots to speak when spoken to), it analyzes the statement (it assumes a question) and searches the database for the most relevent answer using MySQL's fulltext index. The code to do it is amazingly simple, and if you populate your database correctly it can effectively act as an FAQ robot.

Brilliant!

Where can I get it?

Right here: http://www.hungryhacker.com/downloads/ircoracle.tgz.

How do I use it?

Any damn way you want to. It's BSD licensed. You need help compiling it? Too bad, welcome to free software, baby. No support is offered, but if you catch me on IRC I might help you compile it if you can't. There's no ./configure script or anything - a fire-and-forget Makefile that assumes BSD-style library paths is about the best I felt like doing.

Oh. Tables. Mine looks like this:

mysql> describe oracle; +----------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+---------------------+------+-----+---------+----------------+ | id | bigint(20) unsigned | | PRI | NULL | auto_increment | | response | tinytext | | | | | | trigger | tinytext | | MUL | | | +----------+---------------------+------+-----+---------+----------------+

I should mention above that trigger is a fulltext index. Look that up.

Response is the answer you'd like it to give, trigger is a space-seperated list of words that relate to the answer you're giving. MySQL fulltext rules apply, so things like <4 letter words don't count for example. The count and order of words matter, but I'm sure you can read more about fulltext elsewhere.

Configuration

Configuration is done by editing include/config.h, the Makefile, the code directly, or by specifying stuff on the command line. Consult the code for the command line options.

Bugs

It's crawling with them - and I don't want to know about it. If you've modified it and improved it any, feel free to send me the changes and I'll post them, with full credit of course. I don't really think all that much of this code, so if you happen to find it useful in any way, shoot me an email to let me know you have fun with it.

Demo?

Unless it's fallen and can't get up, a demo of the program is generally to be found running in #moo on MooIRC. Play with it if you want, but we haven't taught it much.