/ Published in: Perl
I no longer use ICQ, but I still have dozens of contacts there. To let them know of other ways to contact me I wrote this little script.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/perl use warnings; use strict; my $screenname = 'screenname'; my $password = 'password'; my $logfile = '~/aimbot.log'; my $oscar; $oscar->set_callback_im_in(\&im_in); $oscar->signon($screenname, $password); while(1) { $oscar->do_one_loop(); } sub im_in { my($oscar, $sender, $message, $is_away) = @_; # respond to the poor soul still using ICQ my $response = "Sorry, I am no longer using ICQ. " . "If you need to contact me, try sending me an " . "email/Jabber/GTalk message at 'me\@domain.com'. " . "(This is an automated response.)\n"; $oscar->send_im($sender, $response); # save the message to the log-file close LOG }