Skip to content

Instantly share code, notes, and snippets.

@sartak
Created June 27, 2009 16:09
Show Gist options
  • Save sartak/137031 to your computer and use it in GitHub Desktop.
Save sartak/137031 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use IM::Engine;
IM::Engine->new(
interface => {
# protocol => 'Jabber',
# credentials => {
# jid => '...',
# password => '...',
# host => 'jabber.org',
# },
# protocol => 'AIM',
# credentials => {
# screenname => '...',
# password => '...',
# },
protocol => 'IRC',
credentials => {
server => 'irc.perl.org',
channels => ['#im-engine'],
nick => '...',
},
incoming_callback => sub {
my $incoming = shift;
my $message = $incoming->message;
$message =~ tr[a-zA-Z][n-za-mN-ZA-M];
return $incoming->reply(
message => $message,
);
},
},
)->run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment