3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Fix compliment module

This commit is contained in:
Pragmatic Software 2014-07-02 20:54:17 +00:00
parent 8d38af0d69
commit d320d5e04a
2 changed files with 7 additions and 6 deletions

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script # These are set automatically by the build/commit script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 696, BUILD_REVISION => 697,
BUILD_DATE => "2014-07-02", BUILD_DATE => "2014-07-02",
}; };

View File

@ -128,7 +128,7 @@ sub urban_search {
my $content = shift; my $content = shift;
my $term = shift; my $term = shift;
my @rawlines = $content =~ /<div class=["'](definition|example|def_p)["']>(.+?)<\/?div/gism; my @rawlines = $content =~ /<div class=["'](meaning|definition|example|def_p)["']>(.+?)<\/?div/gism;
my @lines; my @lines;
foreach (@rawlines) { foreach (@rawlines) {
my @s = split /(?:\n|<br\/?>)/; my @s = split /(?:\n|<br\/?>)/;
@ -148,7 +148,7 @@ sub urban_search {
$s =~ s/\s*$//; $s =~ s/\s*$//;
$s =~ s/<.+?>//g; $s =~ s/<.+?>//g;
if ($s =~ /(definition|def_p)/) { if ($s =~ /(meaning|definition|def_p)/) {
$def_word++; $def_word++;
} elsif ($s =~ /example/) { } elsif ($s =~ /example/) {
# Do nothing # Do nothing
@ -231,6 +231,7 @@ sub wwotd_search {
## ##
# Dictionary.com word of the day # Dictionary.com word of the day
## ##
=cut
sub wotd_search { sub wotd_search {
my $content = shift; my $content = shift;
@ -241,7 +242,7 @@ sub wotd_search {
return join ("\n", @lines); return join ("\n", @lines);
} }
=cut
## ##
# Sloganizer # Sloganizer
## ##
@ -669,7 +670,7 @@ sub process_request {
# whitespace delimited lines up to 400 characters long # whitespace delimited lines up to 400 characters long
# to prevent IRSSI truncating the output lines # to prevent IRSSI truncating the output lines
my @lines = $result =~ /(.{0,400})(?:\r|\n|\s+|$)/g; my @lines = $result =~ /(.{0,400})(?:\r|\n|\s+|$)/g;
@lines = () unless defined @lines; @lines = () unless @lines;
my @output = (); my @output = ();
foreach my $text (@lines) { foreach my $text (@lines) {
@ -722,7 +723,7 @@ sub public_responder {
my @lines = process_request($trigger, $term, $server, $nick, $target); my @lines = process_request($trigger, $term, $server, $nick, $target);
# Display if necessary # Display if necessary
if (defined @lines) { if (@lines) {
$server->command("msg $target -!- $_") $server->command("msg $target -!- $_")
for grep { /./ } @lines; for grep { /./ } @lines;
} }