Net::AIM::TOC - Perl implementation of the AIM TOC protocol
The Net::AIM::TOC module implements in AIM TOC protocol in such a way which make it simple for using when writing bots or AIM clients in Perl.
Net::AIM::TOC
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.
use Error qw( :try ); use Net::AIM::TOC; try { my $aim = Net::AIM::TOC->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::AIM::TOC::Error with { my $err = shift; print $err->stringify, "\n"; };
A Net::AIM::TOC 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.
connect
sign_on
Returns Net::AIM::TOC object but does not create a connection or sign on to the AIM service.
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 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.
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.
Sends whatever string is passed in on to the AIM service. Useful for sending toc commands.
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::AIM::TOC::Messages object. See the documentation for this object is to be used.
Net::AIM::TOC::Messages
Disconnects from the AIM service.
None, but that does not mean there are not any.
Alistair Francis, http://search.cpan.org/~friffin/
To install Net::AIM::TOC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::AIM::TOC
CPAN shell
perl -MCPAN -e shell install Net::AIM::TOC
For more information on module installation, please visit the detailed CPAN module installation guide.