Bot::BasicBot::Pluggable::Module::Websters - give the url of a word in Websters


Bot-BasicBot-Pluggable-Module-Search documentation Contained in the Bot-BasicBot-Pluggable-Module-Search distribution.

Index


Code Index:

NAME

Top

Bot::BasicBot::Pluggable::Module::Websters - give the url of a word in Websters

SYNOPSIS

Top

This is almost useless but it's provided as part of Infobot backwards compatability.

IRC USAGE

Top

    websters (for ) <word>

AUTHOR

Top

Simon Wistow, <simon@thegestalt.org>

COPYRIGHT

Top

SEE ALSO

Top


Bot-BasicBot-Pluggable-Module-Search documentation Contained in the Bot-BasicBot-Pluggable-Module-Search distribution.

package Bot::BasicBot::Pluggable::Module::Websters;

use strict;
use Bot::BasicBot::Pluggable::Module; 
use base qw(Bot::BasicBot::Pluggable::Module);


sub said { 
    my ($self, $mess, $pri) = @_;

    my $body = $mess->{body}; 
    my $who  = $mess->{who};

    return unless ($pri == 2);

    return unless $body =~ s!^\s*websters (for )?!!i;
    
    return "You must supply a word" unless $body =~ /\w+/;
    my $q = $body; $q =~ s/\W+/+/g;
    return "$body may be sought at http://www.m-w.com/cgi-bin/dictionary?va=$q";

}

sub help {
    return "Commands: 'websters (for ) <word>'";
}

1;