]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/Google.pl
* Google module should now return a URI as is, without converting chars that could...
[infobot.git] / 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);