Here's a short read-only chatterbox client in perl. It uses the perl chatterbox client module and Curses (barely).
Usage:
e2chatterbox.pl [username] [password]
#!/usr/bin/perl -w
use strict;
use Curses;
use E2Chatterbox2;
use Text::Wrap;
my $cbox = new E2Chatterbox2;
if ( scalar( @ARGV ) >= 2 ) {
$cbox->login( @ARGV[0,1] );
}
$SIG{INT} = sub { endwin(); exit; };
initscr();
noecho();
scrollok(1);
while (1) {
my ( $chatter, $msg ) = $cbox->get_all();
# clear();
erase();
foreach my $line ( @$chatter ) {
my ( $time, $speaker, $speech ) = @$line;
$speech =~ s/\&/\&/g;
$speech =~ s/\"/"/g;
addstr( Text::Wrap::wrap("", "\t",
"[$time] $speaker: $speech\n") );
}
if ( scalar( @$msg ) ) {
addstr( "----------------------- Messages -----------------------\n" );
foreach my $line ( @$msg ) {
my ( $time, $speaker, $speech, $id ) = @$line;
$speech =~ s/\&/\&/g;
$speech =~ s/\"/"/g;
addstr( Text::Wrap::wrap("", "\t",
"[$time/$id] $speaker: $speech\n") );
}
}
refresh();
sleep( 15 );
}
endwin();