#!/usr/bin/perl
#
# $Revision: 1.3 $ $Date: 2012-07-26 17:11:48-04 $
# $Source: /home/vogelke/bin/RCS/mkquery,v $
# $Host: sys7.com $
# $UUID: e2c37300-4380-348d-ae05-d6571df824a8 $
#
#<mkquery: read sentences, write Google query links.
#
# input: foo bar baz
# url: http://www.google.com/search?hl=en&source=hp&q=%22foo+bar+baz%22

$site = 'http://www.google.com/search?hl=en&source=hp&q=';
print "<ul>\n";

while (<>) {
    chomp;
    $str = $_;
    s/^  *//g;
    s/  *$//g;
    s/  */+/g;
    $url = "$site" . "%22$_%22";     # %22 = double-quote
    print "<li>\n<a href=\"$url\">\n$str</a>\n</li>\n";
}

print "</ul>\n";
exit(0);
