X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FModules%2Fwikipedia.pl;h=13ce1bf95f102354db88030d33730b00620e8cca;hb=3936a3e1255582305fc4200485b71fa692e66bd3;hp=9117b87f590c741d26589705d696ef10d4f7e768;hpb=8b54ff5060a6605e169acc0694cb00b89ed22cab;p=infobot.git diff --git a/src/Modules/wikipedia.pl b/src/Modules/wikipedia.pl index 9117b87..13ce1bf 100644 --- a/src/Modules/wikipedia.pl +++ b/src/Modules/wikipedia.pl @@ -50,7 +50,7 @@ sub wikipedia_lookup { &::DEBUG("wikipedia($phrase)"); my $ua = new LWP::UserAgent; - $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam("httpProxy")); + $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam('httpProxy')); # Let's pretend $ua->agent("Mozilla/5.0 " . $ua->agent); $ua->timeout(5); @@ -137,7 +137,7 @@ sub wikipedia_lookup { #$text = substr($text, 0, 330); #$text =~ s/(.+)\.([^.]*)$/$1./g; - return("At " . $url . " (URL), Wikipedia explains: " . $text, + return('At ' . $url . " (URL), Wikipedia explains: " . $text, 1); } } @@ -150,7 +150,7 @@ sub wikipedia_get_text { &::DEBUG("wikipedia_get_text($article)"); my $ua = new LWP::UserAgent; - $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam("httpProxy")); + $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam('httpProxy')); # Let's pretend $ua->agent("Mozilla/5.0 " . $ua->agent); $ua->timeout(5); @@ -174,19 +174,19 @@ sub wikipedia_get_text { } elsif (/#REDIRECT\s*\[\[(.*?)\]\]/i) { $redirect = $1; $redirect =~ tr/ /_/; - &::DEBUG("wiki redirect to " . $redirect); + &::DEBUG('wiki redirect to ' . $redirect); last; } elsif (/]*>(.*)/) { $text = '"' . $1; } elsif (/(.*)<\/text>/) { - $text = $text . " " . $1 . '"'; + $text = $text . ' ' . $1 . '"'; last; } elsif ($text) { - $text = $text . " " . $_; + $text = $text . ' ' . $_; } } &::DEBUG("wikipedia returned text: " . $text . - ", redirect " . $redirect. "\n"); + ', redirect ' . $redirect. "\n"); if (!$redirect and !$text) { return ($res->as_string);