AOL-TOC

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

This is a perl module to integrate with AOL's TOC protocol for instant
messaging. I found this a while ago on www.foo.org/~james/, which appears to
have gone awol. As far as I know, there isn't anywhere else to get it, so
I'm cleaning it up for CPAN and including it here. 

The original author is james@foo.org, and his README file is included as
README.old

Joshua Harding
xjharding@newbedford.k12.ma.us

SFLAP.pm  view on Meta::CPAN


  for $func (@{$self->{callback}{$chan}}) {
    #print ("callback() calling a func $func for $chan fd $self->{fd}..\n");
    eval { &{$func} ($self, @args, @{$self->{callback}{$func}}) };
  }

  return;
}

sub new {
  my ($tochost, $authorizer, $port, $nickname) = @_;
  my $self;
  my $ipaddr;

  if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
  die "invalid port" unless $port;

  $ipaddr = inet_aton($tochost);
  die "unknown host" unless $ipaddr;

  $self = {
    tochost	=> $tochost,
    authorizer	=> $authorizer,
    ipaddr	=> $ipaddr,
    port	=> $port,
    nickname	=> $nickname,
    sequence    => 1
  };
  bless($self);

  return $self;
}

TOC.pm  view on Meta::CPAN


=head1 SYNOPSIS

  use AOL::TOC;
  $toc = AOL::TOC::new($toc_server, $login_server, $port,
         $screenname, $password); 
  $toc->connect();

=head1 DESCRIPTION

This module implements SFLAP, which I presume to be AOL's authenticiation
protocol, and TOC, which is the actual "meat" of the AIM protocol.

=head1 INTERFACE

=head2 connect

connects to the AIM server

=head2 register_callback

TOC.pm  view on Meta::CPAN


Takes one argument, the name of the chat room to join

=head2 chat_send

Takes two arguments, the name of the chat room, and the message.

=head1 AUTHOR

xjharding@newbedford.k12.ma.us cleaned it up and added DOC
james@foo.org was the original author

=head1 SEE ALSO

Net::AIM, a new module, but it doesn't have the features of this one

=cut

sub roast_password {
  my ($password, $key) = @_;
  my @skey;

TOC.pm  view on Meta::CPAN

  }

  print "...............S TOC scan callbacks\n";
  for $k (keys %{$self->{callback}}) {
    print ".............S Scan key ($k)\n";
  }
}


sub new {
  my ($tochost, $authorizer, $port, $nickname, $password) = @_;
  my ($self, $ipaddr, $sflap);

  $self = { 
      nickname => $nickname, 
      password => $password, 
      caller => "file:line" 
      };
  
  bless($self);

  $sflap = AOL::SFLAP::new($tochost, $authorizer, $port, $nickname);
  $self->{sflap} = $sflap;

  #print "*************************** AOL::TOC::new(...) sflap = $self->{sflap}\n";
  #print "                            sflap cb = $self->{sflap}{callback}\n";

  #$self->{sflap}->register_callback($AOL::SFLAP::SFLAP_SIGNON,    \&sflap_signon, $password, "english", "TIK:\$Revision: 1.148 \$", $self);
  #$self->{sflap}->register_callback($AOL::SFLAP::SFLAP_DATA,      \&sflap_data, $self);
  #$self->{sflap}->register_callback($AOL::SFLAP::SFLAP_ERROR,     \&sflap_error, $self);
  #$self->{sflap}->register_callback($AOL::SFLAP::SFLAP_SIGNOFF,   \&sflap_signoff, $self);
  #$self->{sflap}->register_callback($AOL::SFLAP::SFLAP_KEEPALIVE, \&sflap_keepalive, $self);

TOC.pm  view on Meta::CPAN

sub dispatch {
  my ($self) = @_;

  $self->{sflap}->recv();
}


# Utilities

sub signon {
  my ($self, $authorizer, $port, $nickname, $roasted_password, $language, $version) = @_;

  $self->send("toc_signon $authorizer $port $nickname $roasted_password $language " . &encode_string($version));
  return;
}

sub init_done {
  my ($self) = @_;

  $self->send("toc_init_done");
  return;
}

TOC.pm  view on Meta::CPAN


sub sflap_signon {
  my ($self, $data, $password, $language, $version, $toc) = @_;
  my ($buffer, $roasted_password);

  $roasted_password = roast_password($password, $ROASTING_KEY);

  $buffer = pack("Nnna*", 1, 1, length($toc->{sflap}->{nickname}), $toc->{sflap}->{nickname});
  $toc->{sflap}->send($AOL::SFLAP::SFLAP_SIGNON, $buffer);

  $toc->signon($toc->{sflap}->{authorizer}, $toc->{sflap}->{port}, $toc->{sflap}->{nickname}, $roasted_password, $language, $version);
}

sub sflap_data {
  my ($self, $data, $toc) = @_;
  my ($cmd, $args);

  ($cmd, $args) = ($data =~ /^(\w+)\:(.*)$/);

  return unless defined $cmd && defined $args;

tocbot/tocbot.config  view on Meta::CPAN

#
# tocbot.config
#

@tocbot_modules = ("ident", "relay", "do", "fortune");

%tocbot_config = (
  tochost	=> "toc.oscar.aol.com",
  authorizer	=> "login.oscar.aol.com",
  port		=> 443,
  nickname	=> "vaxd00d",
  password	=> "qazwsx"
)

tocbot/tocbot.pl  view on Meta::CPAN

for $name (@tocbot_modules) {
  print "tocbot: loading module $name\n";
  require "$name".".pl";
  eval { &{$name . "_init"} };
}

open(client_config, "toc.config");
$client_config = join('', <client_config>);
close(client_config);

$toc = AOL::TOC::new($tocbot_config{tochost}, $tocbot_config{authorizer},
                     $tocbot_config{port},
                     $tocbot_config{nickname}, $tocbot_config{password});
#$toc->set_debug(9);
$toc->connect();

$toc->register_callback("ERROR", \&client_error);
$toc->register_callback("CLOSED", \&client_closed);
$toc->register_callback("SIGN_ON", \&client_signon);
$toc->register_callback("IM_IN", \&client_im);
$toc->register_callback("UPDATE_BUDDY", \&client_buddy);



( run in 0.720 second using v1.01-cache-2.11-cpan-5c0b1e786e0 )