From: djmcgrath Date: Tue, 2 Dec 2008 23:58:34 +0000 (+0000) Subject: * Msg user with "not found" status instead of reporting nil to the channel X-Git-Url: https://git.donarmstrong.com/?p=infobot.git;a=commitdiff_plain;h=4ed8a293e142c1b923cd8239a05fc5bff8b14caa * Msg user with "not found" status instead of reporting nil to the channel git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1855 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Modules/Google.pl b/src/Modules/Google.pl index 1fab907..3ed1c81 100644 --- a/src/Modules/Google.pl +++ b/src/Modules/Google.pl @@ -36,11 +36,19 @@ sub GoogleSearch { return; } + # No results found + if ( not $Search->responseData->results ) { + &::DEBUG( "Google::GoogleSearch> $retval" ); + &::msg( $::who, $retval); + &::msg( $::who, $Search->responseStatus ); + return; + } + my $data = $Search->responseData; my $cursor = $data->cursor; my @results = $data->results; - my $count; + $retval = "$where says \"\002$what\002\" is at "; foreach my $r (@results) { my $url = $r->url;