hail2u / blosxom-starter-kit

You can create blosxom weblogging system easily with this kit.

This URL has Read+Write access

blosxom-starter-kit / google.cgi
100644 25 lines (15 sloc) 0.406 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/local/bin/perl
 
# This script based on:
# http://www.hyuki.com/netserv/google.html
 
use strict;
 
use CGI qw(:standard);
 
my $q = &uri_escape(param('q'));
my $key = &uri_escape(param('key'));
 
print "Location: http://www.google.com/search?q=$q+$key&ie=UTF-8\n\n";
 
exit;
 
sub uri_escape {
  my $str = shift;
 
  $str =~ s/([^\w ])/sprintf("%%%02X", ord($1))/eg;
  $str =~ tr/ /+/;
 
  return $str;
}