CLAIM is an implementation of AOL's semi-open Instant Messaging protocol, TOC (see PROTOCOL.txt). It allows one to build chatbots and other AIM clients.
CLAIM was placed under the MIT license by I/NET.
First download the code. The easiest way is to use ASDF-INSTALL:
? (asdf-install:install :claim)
Then load the code (with ASDF, “(asdf:operate 'asdf:load-op :claim)” should be sufficient once you've put the directory containing the claim.asd file in asdf:*central-registry*), then load the examples/gossip-bot.lisp file. At the listener, run the start-gossip-bot function:
? (gossip-bot:start-gossip-bot "myusername" "mypassword")
You must use the username and password of an existing AIM account (see http://aim.aol.com/ on how to create a free AIM account).
Anyone can now send messages to and interact with the gossip bot.
CLAIM requires minimal TCP socket support. The file sysdeps.lisp contains a single function definition, MAKE-TCP-SOCKET, that opens a TCP socket. Implementations are provided for OpenMCL, ACL, LispWorks and SBCL.
The TOC protcol is slightly binary, mostly text. Accordingly, I open socket streams in text mode and fake the binary parts. It won't work unless your Lisp's code-char and char-code functions use ASCII.
I've written the code without assuming multiprocessing, but in a way that will work with most multiprocessing implementations. Let me know if it doesn't work out that way.
I checked all the other AIM libraries I could find, and nobody even tries to deal with the "server speed limit", which was a constant problem for me. See the comments at the end of this file for one attempt to solve this problem.
The following implementations of TOC were helpful when writing this one:
This code has been tested in ACL, OpenMCL, SBCL and LispWorks.
There should be much more documentation. I've tried to structure the code so that it is easy to extend and use for chat clients, but documenting what I did would help a lot too. Sorry.
The gossip bot should do some HTML parsing if it wants to work perfectly with iChat; When the bot sends “Someone said you smell”, iChat shows “you smell”.