in reply to Perl and Google API
That's all.#!/usr/bin/perl use SOAP::Lite; use strict; my $key='00000000000000000000000000'; my $fh = "wordList.txt"; open FH, "$fh" or die "Can't open: $!"; open OUTFILE, ">goodWords.txt"; foreach (<FH>) { chomp; print $_; my $googleSearch = SOAP::Lite -> service("file:GoogleSearch.wsdl") +; my $result = $googleSearch -> doGoogleSearch($key, $_, 0, 10, "fal +se", "", "false", "lang_es", "latin1", "latin1"); my $hitCount = qq{$result->{'estimatedTotalResultsCount'}}; print " returns about $hitCount hits.\n"; if ($hitCount > 200) { print OUTFILE "$_ returns about $hitCount hits.\n"; } } close OUTFILE; close FH;
Update: this particular problem solved, with the very kind help of dree. The problem was not with the code, but with Soap::Lite v0.52. dree had Soap::Lite v0.46 and had no problems running the program, and when he upgraded to v0.52 it stopped working (ie., he got the dreaded 500 error). So, I installed 0.46 and hey presto! it's working fine now. Thanks dree!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl and Google API
by keymon (Beadle) on May 18, 2002 at 13:31 UTC | |
by doonyakka (Beadle) on May 18, 2002 at 13:41 UTC |