From d320d5e04aa7befab80cac4557b2f5d895e2b7e4 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 2 Jul 2014 20:54:17 +0000 Subject: [PATCH] Fix compliment module --- PBot/VERSION.pm | 2 +- modules/lookupbot.pl | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index efcd8483..31f7064a 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 696, + BUILD_REVISION => 697, BUILD_DATE => "2014-07-02", }; diff --git a/modules/lookupbot.pl b/modules/lookupbot.pl index 30569113..1787dde1 100755 --- a/modules/lookupbot.pl +++ b/modules/lookupbot.pl @@ -128,7 +128,7 @@ sub urban_search { my $content = shift; my $term = shift; - my @rawlines = $content =~ /
(.+?)<\/?div/gism; + my @rawlines = $content =~ /
(.+?)<\/?div/gism; my @lines; foreach (@rawlines) { my @s = split /(?:\n|)/; @@ -148,7 +148,7 @@ sub urban_search { $s =~ s/\s*$//; $s =~ s/<.+?>//g; - if ($s =~ /(definition|def_p)/) { + if ($s =~ /(meaning|definition|def_p)/) { $def_word++; } elsif ($s =~ /example/) { # Do nothing @@ -231,6 +231,7 @@ sub wwotd_search { ## # Dictionary.com word of the day ## +=cut sub wotd_search { my $content = shift; @@ -241,7 +242,7 @@ sub wotd_search { return join ("\n", @lines); } - +=cut ## # Sloganizer ## @@ -669,7 +670,7 @@ sub process_request { # whitespace delimited lines up to 400 characters long # to prevent IRSSI truncating the output lines my @lines = $result =~ /(.{0,400})(?:\r|\n|\s+|$)/g; - @lines = () unless defined @lines; + @lines = () unless @lines; my @output = (); foreach my $text (@lines) { @@ -722,7 +723,7 @@ sub public_responder { my @lines = process_request($trigger, $term, $server, $nick, $target); # Display if necessary - if (defined @lines) { + if (@lines) { $server->command("msg $target -!- $_") for grep { /./ } @lines; }