cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:

A while ago I asked whether anyone had built a working ICQ client in Perl (Working Net::ICQ client anyone?).

I never did get any good replies, but I'm thinking of tackling it again, so thought I'd throw out how I think it would work and hope someone will pitch in with their thoughts:

1. write a local client/server that runs locally listening for send requests, whilst keeping the ICQ session open with the ICQ server

2. write a module to send the messages to the listening ICQ client/server. Eg, following methods:

my $icq = ICQserve::new(); $icq->uin(123456); $icq->message("this is the message"); $icq->send();
If the client/server is down, it restarts it (hopefully it would die nicely to an error log somewhere :-)

But, not being a sysadmin type, and not having done a lot of socket stuff, I wonder whether I'd encounter problems with keeping a port (socket? whatever...) open locally to listen for ICQ messages to send (only from local scripts). I was also thinking of pumping received messages through a script too, but let's keep it to sending just for now.

So has anyone made any progress on this? Is there anyone out there who would like to pitch in to make this work? - I think i may need some help with the sockets stuff.

I just think it would be damn useful for server alerts etc... Or am I just reinventing the wheel - ie, is there a shell ICQ client already available that we could pipe stuff to?

All thoughts welcomed on this.

cLive ;-)

--
seek(JOB,$$LA,0);

Replies are listed 'Best First'.
Re: ICQ using Perl
by ferrency (Deacon) on May 09, 2002 at 14:56 UTC
    If I were you, I'd break up the problem slightly differently . Write a module which handles parsing and creation of the ICQ protocol in a transport-independant way. That would be generally useful to work with ICQ protocol streams no matter how you get them. Leave the client/server stuff to modules which others have already written.

    Update: Doh! Nevermind :) I obviously didn't see your earlier post (and didn't know about Net::ICQ).

    I've had some luck with Net::Server and NetServer::Generic for this sort of thing.

    Alan

      If you read my earlier post, you'd see I was going to base all this on the Net::ICQ module (if it still works :)

      From my previous attempt, I realise that I need to run a local ICQ server that is a client for the AOL ICQ server. This was the bit I need some help with.

      Leave the client/server stuff to modules which others have already written. - perhaps a pointer here as to which modules are best for this would be helpful :)

      cLive ;-)

      --
      seek(JOB,$$LA,0);

Re: ICQ using Perl
by Dog and Pony (Priest) on May 10, 2002 at 14:24 UTC

    A while ago I asked whether anyone had built a working ICQ client in Perl

    Have a look at vICQ. Also have a look at the (on that page) mentioned Net::ICQ2000, since I had lots of trouble with Net::ICQ and I think lots of it is attributed to the fact that it uses old, outdated protocols. But I am not sure.

    I just think it would be damn useful for server alerts etc...

    If you just want server monitors to alert you via ICQ, have them send emails to your-icq-uin@pager.icq.com - I used to monitor web sites this way at my old job. Not that this is much fun compared to hacking your own. :)

    is there a shell ICQ client already available that we could pipe stuff to?

    Have a look at CenterICQ. I've run this client now and then, and it appears to be very stable and so on. What is useful with it is that you can send events via the command line when it is running, and that you can customize it with external scripts that are run upon rules that you set. There are quite a few examples (just click next at the bottom), of which the one titled Remote control with external actions probably is really interesting to you. :)

    There is also mICQ that is a pure command line client, but I haven't tried it.

    Hope any of these things help you out.


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.