A long time ago I used to run a site called icqbot.net where I distributed a free perl script that would connect to ICQ and have conversations with them.. it utilized the elizatalk AI engine as it’s brain and then later a different system called MegaHAL.. it wasn’t until AOL came after me for violating their trademark in my domain name ( they own ICQ ).. so the party was over.
Today I happened upon a site called Clever Omegle ( http://www.iywib.com/cleverbot_omegle.php ) and LOVED it.. It basically takes the random chat of omegle and marries it with the AI of cleverbot.com to create something really entertaining.
I decided I could utilize this to bring my old bot back to life! but I really didn’t want to reverse engineer protocols again and there wasn’t any great libraries out there to write the connection part. This is when I discovered the OpenFire XMPP server ( http://www.igniterealtime.org/projects/openfire/ ) by “Ignite” .. there is a linux and windows version..
Openfire would be my connection point from PHP to the other networks.. to do that I would need to install the latest beta Openfire plugin called Kraken ( http://sourceforge.net/projects/kraken-gateway/files/kraken-gateway/ ) which allows connection to ICQ, AIM, Yahoo and many other popular networks.. all you have to do is register your accounts and link them to your account on your Openfire server.
Once that was complete, I found a PHP class that allowed connection to cleverbot, all you do is pass a message and get a response.. I would link to that but Cleverbot’s folks are very quick to slap the hands of people who do this sort of thing and I’m doing it merely to see if I could! ( and it’s fun ) .. so you’ll have to scour the net to find methods to communicate with cleverbot via PHP.
Once I had that interaction working.. I downloaded the xmpphp library ( http://code.google.com/p/xmpphp/ ) and used the author’s example as the base for my bot.. the only thing I had to do with adjust the connection string to point to my server with my credentials and then inject code to load up the cleverbot class I found.. when an incoming message was detected, I pass that to the cleverbot object and pass back the response.
This has MANY advantages over my old bot.. it can connect with virtually any network.. it has a much stronger AI powering it.. and the Openfire server has a monitoring plugin that collects chat logs FOR me .. so I don’t have to code any of that junk.
The code writing to accomplish this was minimal .. the author’s example xmpp code was just under a hundred lines and I only had to write 5 lines of code in myself to tie the pieces together.
If you want a more detailed process, shoot me a message via my contact form and I’ll be happy to assist… if you know of any public xmpp servers out there with support for multiple protocols then you’re already 90% there 😉