#/usr/bin/perl -w use strict; use LWP::Simple; use URI::Escape; use URI::URL; my $currentAlice = 0; my @bots = ( int( rand 999999 ) + 1, int( rand 999999 ) + 1 ); print "Enter starting text for ALICE $currentAlice: "; chomp( my $text = ); while (1) { print "ALICE $currentAlice: $text\n"; my $url = URI::URL->new( "http://alicebot.org/a.l.i.c.e./CHAT" ); $url->query_form( text => uri_escape( $text ), virtual => "alice$bots[$currentAlice]", submit => 'reply' ); my $source = get( $url ); next unless $source; $source =~ m,(.*?)
,s; $text = $1; $text =~ s/<[^>]*>//g; $text =~ s/\s+/ /sg; $currentAlice ^= 1; sleep( 1 ); }