NAME

Net::AIMTOC - Perl implementation of the AIM TOC protocol

DESCRIPTION

The Net::AIMTOC module implements in AIM TOC protocol in such a way which make it simple for using when writing bots or AIM clients in Perl.

All of the code regarding the connection is abstracted in order to simplify the AIM connection down to merely sending and receiving instant messages and toc commands.

SYNOPSIS

use Error qw( :try );
use Net::AIMTOC;

try {
  my $aim = Net::AIMTOC->new;
  $aim->connect;
  $aim->sign_on( $screenname, $password );

  my $msgObj = $aim->recv_from_aol;
  print $msgObj->getMsg, "\n";
  $aim->send_im_to_aol( $buddy, $msg );

  $aim->disconnect;
  exit( 0 );

}
catch Net::AIMTOC::Error with {
  my $err = shift;
  print $err->stringify, "\n";

};

CLASS INTERFACE

CONSTRUCTORS

A Net::AIMTOC object is created by calling the new constructor without arguments. A reference to the newly created object is returned, however, no connection to AIM has yet been made. One first is required to called connect and sign_on before attempting to send/receive instant messages.

new ()

Returns Net::AIMTOC object but does not create a connection or sign on to the AIM service.

OBJECT METHODS

connect ( ARGS )

The connect method can be called without arguments to connect to the AIM service using the default AIM servers.

Alternatively, a hash containing any of the following keys can be passed in to connect to another service using the TOC protocol:

-tocServer
-tocPort
-authServer
-authPort
sign_on ( ARGS )

sign_on is called to sign on to the AIM service. The arguments to be passed in are the screen name and password to be used to sign on to the service.

send_im_to_aol ( ARGS )

Sends an instant message. The first argument should be the name of the receipient buddy and the second argument is the message which you are sending.

send_to_aol ( ARGS )

Sends whatever string is passed in on to the AIM service. Useful for sending toc commands.

recv_from_aol ()

Receives any data sent from the AIM service. This includes all TOC protocol messages (including instant messages), however, PAUSE And SIGN_ON messages are handled internally.

This method returns a Net::AIMTOC::Messages object. See the documentation for this object is to be used.

disconnect ()

Disconnects from the AIM service.

KNOWN BUGS

None, but that does not mean there are not any.

SEE ALSO

Net::AIMTOC::Messages

AUTHOR

Alistair Francis, http://search.cpan.org/~friffin/