http://www.perlmonks.org?node_id=241357


in reply to Re: check words popularity using Google
in thread check words' popularity using Google

OK, here's a quick rewrite using SOAP::Lite instead of screen-scraping. Now I'm off to install Net::Google and DBD::google to see what they can offer!

#!/usr/bin/perl use warnings; use strict; use SOAP::Lite; my $key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; die "Usage: goolies2 word1 word2\n" unless @ARGV; foreach my $query (@ARGV) { my $googleSearch = SOAP::Lite->service("file:GoogleSearch.wsdl"); my $result = $googleSearch->doGoogleSearch($key, $query, 0, 10, "f +alse", "", "false", "", "latin1", latin1"); print "$query returned about $result->{'estimatedTotalResultsCount +'} results.\n"; } __END__ sample output: heather nova returned about 136000 results. sheryl crow returned about 238000 results. avril lavigne returned about 463000 results.