]> git.donarmstrong.com Git - infobot.git/commitdiff
* Google module should now return a URI as is, without converting chars that could...
authordjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 25 Jan 2009 04:27:16 +0000 (04:27 +0000)
committerdjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 25 Jan 2009 04:27:16 +0000 (04:27 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1863 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/Google.pl

index a8a66f93de1cdf2b4347e68c6fea0b0861d0ef5f..41187a6d33a5a59ddb6bc0089ef1765f24fbf944 100644 (file)
@@ -51,9 +51,14 @@ sub GoogleSearch {
     $retval = "$where says \"\002$what\002\" is at ";
     foreach my $r (@results) {
         my $url = $r->url;
+
+        # Returns a string with each %XX sequence replaced with the actual byte
+        # (octet). From URI::Escape uri_unescape()
+        $url =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
+
         $retval .= " \002or\002 " if ( $count > 0 );
         $retval .= $url;
-        last if ++$count >= $maxshow;
+        last if ++$count >= $maxshow; # Only seems to return max of 4?
     }
 
     &::performStrictReply($retval);