Here's more code from the generous i/net vaults. It lets you write AIM chatbots in lisp, and is made available under the MIT license.
Tarball: claim-1.0.tar.gz
Source code (if you just want to browse): claim-1.0.lisp, gossip-bot-1.0.lisp
lately I've been thinking it could be fun to add this as a backend for one of the CLIM IRC clients that people are working on these days.
Here's the documentation.
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.
Load this code, 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 a lisp that supports the ACL socket API (see <http://www.franz.com/support/documentation/6.1/doc/socket.htm>, and <http://ww.telent.net/cliki/ACL-COMPAT>). Actually, all you need is a function socket:make-socket for connecting to a remote host (in text mode).
For example, in OpenMCL the following is sufficient:
(defpackage :socket (:use :common-lisp) (:shadowing-import-from :ccl #:make-socket) (:export #:make-socket))
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/Linux, OpenMCL/OS X and MCL. At one point it was known to run on ACL/Windows and CMUCL/Linux as well.
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.
Posted by jjwiseman at July 22, 2002 12:06 AMpatched to use acl-compat, why does it hang after connect on CMUCL ??
Posted by: on February 20, 2003 06:19 AMIs anyone still working on this at all??? I'd love an answer as to why it hangs after connect on CMUCL. It connects, screenname sucessfully logs on, but it won't recieve instant messages...
Posted by: on May 4, 2004 07:07 AM