Internet Messenger on Auto-Reply!

I get a lot of questions from people about a few products that I support on Yahoo Messenger.
My idea is to write a program(plug-in?) to automatically parse these queries and see if
there is any answer already present in the online manual/database. And send them back
as a response.

Is this possible to do? It would be ok if I could implement this for other providers like Gtalk or other.

After searching a bit on the internet, I think the way to go about this would be to write a Jabber-client?
But isn’t a client too heavy? Some process that listens to incoming connections to that port and automatically
replies would be sufficient!

After some more searching, I guess this can be implemented in Yahoo! Messenger with their available SDK for Messenger. But, the manual is heavily Windows-centric. Not much info on how to do it on Linux/Ubuntu.
Please let me know how one would go about implementing a similar thing for Gtalk…

Any pointers would be very helpful.

Thanks!