1#!perl -w 2#!d:\perl\bin\perl.exe 3 4# -- SOAP::Lite -- soaplite.com -- Copyright (C) 2001 Paul Kulchenko -- 5 6# Google Web API: http://www.google.com/apis/ 7# NB: Register and get your own key first 8# see also: 9# http://interconnected.org/home/more/GoogleSearch.pl.txt 10# http://aaronland.net/weblog/archive/4205 11# http://www.oreillynet.com/cs/weblog/view/wlg/1283 12 13use SOAP::Lite; 14 15my $key = '0'; # <<< put your key here 16my $query = shift || 'soap'; 17 18# use GoogleSearch.wsdl file from Google developer's kit 19# update path to file to make it work 20# GoogleSearch.wsdl is NOT included 21my $google = SOAP::Lite->service('file://GoogleSearch.wsdl'); 22my $result = $google->doGoogleSearch( 23 $key, $query, 0, 10, 'false', '', 'false', '', 'latin1', 'latin1'); 24 25die $google->call->faultstring if $google->call->fault; 26print "About $result->{'estimatedTotalResultsCount'} results.\n"; 27