/usr/share/doc/libbot-basicbot-perl/examples/namer.pl is in libbot-basicbot-perl 0.89-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | =head1 NAME
namer - read out url titles in the channel
=cut
#!/usr/bin/perl
package Bot;
use base qw(Bot::BasicBot);
use warnings;
use strict;
use URI::Title qw( title );
use URI::Find::Simple qw( list_uris );
sub said {
my $self = shift;
my $message = shift;
my $body = $message->{body};
return unless my @urls = list_uris($message->{body});
$self->reply($message, title($_)) for (@urls);
}
Bot->new(
server => "irc.perl.org",
channels => [ '#jerakeen' ],
nick => 'namer',
)->run();
|