NAME
IM::Engine - The HTTP::Engine of instant messaging
SYNOPSIS
IM::Engine->new(
interface => {
protocol => 'AIM',
credentials => {
screenname => '...',
password => '...',
},
incoming_callback => sub {
my $incoming = shift;
my $message = $incoming->plaintext;
$message =~ tr[a-zA-Z][n-za-mN-ZA-M];
return $incoming->reply($message);
},
},
)->run;
DESCRIPTION
IM::Engine abstracts away the details of talking through different IM services. A Jabber bot will be essentially the same as an AIM bot, so IM::Engine facilitates switching between these different services.
It is currently alpha quality with serious features missing and is rife with horrible bugs. I'm releasing it under the "release early, release often" doctrine. Backwards compatibility may be broken in any subsequent release.
PROTOCOLS
IM::Engine currently understands the following protocols:
AIM
Talks AIM using Net::OSCAR:
IM::Engine->new(
interface => {
protocol => 'AIM',
credentials => {
screenname => 'foo',
password => '...',
},
},
# ...
);
Jabber
Talks XMPP using AnyEvent::XMPP:
IM::Engine->new(
interface => {
protocol => 'Jabber',
credentials => {
jid => 'foo@gchat.com',
password => '...',
},
},
# ...
);
REPL
Opens up a shell where every line of input is an IM. Responses will be printed to standard output. Handy for testing.
IM::Engine->new(
interface => {
protocol => 'REPL',
},
# ...
);
CLI
Pass your IM as command-line arguments. Your response will be printed to standard output. Handy for testing but could also be distributed as a useful script (I want this for Hiveminder's IM interface :)
)
IM::Engine->new(
interface => {
protocol => 'CLI',
},
# ...
);
AUTHOR
Shawn M Moore, sartak@gmail.com
SEE ALSO
COPYRIGHT AND LICENSE
Copyright 2009 Shawn M Moore.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.