2 ###APPNAME: googleImage.pl
4 ###APPDATE: 2009-08-25 04:22:53
6 ###APPDESC: googleImage.pl
8 ###APPEXAMPLE: googleImage.pl
12 #ENV variable MUST be defined somewhere,
13 #FOR perl to search modules from,
15 use lib
$ENV{XR_PERL_MODULE_DIR
};
17 use MyPlace
::Script
::Usage qw
/help_required help_even_empty/;
18 #exit 0 if(help_required($0,@ARGV));
19 exit 0 if(help_even_empty
($0,@ARGV));
21 my ($key,$from,$to) = @ARGV;
22 $from = 1 unless($from);
24 $key = uri_escape
($key);
28 foreach my $page ($from .. $to) {
29 my $start = ($page -1) * 18;
30 my $url = 'http://www.google.com/images?hl=en&safe=off&' . "&q=$key&start=$start" . "&gbv=2&as_st=y&tbs=isch:1,isz:lt,islt:xvga&sa=N&ndsp=18";
32 open FI
,"-|","wget",qw{-q
-O
- -e robots
=off
-U Mozilla
/5.0},$url or die("$!\n");
35 my @match = $_ =~ m/imgurl\\x3d([^\\]+)\\x26/g;
36 print $_,"\n" foreach(@match);