From 4ed8a293e142c1b923cd8239a05fc5bff8b14caa Mon Sep 17 00:00:00 2001 From: djmcgrath Date: Tue, 2 Dec 2008 23:58:34 +0000 Subject: [PATCH] * 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 --- src/Modules/Google.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; -- 2.39.2