
Net::Google - simple OOP-ish interface to the Google SOAP API

use Net::Google;
use constant LOCAL_GOOGLE_KEY => "********************************";
my $google = Net::Google->new(key=>LOCAL_GOOGLE_KEY);
my $search = $google->search();
# Search interface
$search->query(qw(aaron straup cope));
$search->lr(qw(en fr));
$search->ie("utf8");
$search->oe("utf8");
$search->starts_at(5);
$search->max_results(15);
map { print $_->title()."\n"; } @{$search->results()};
# or...
foreach my $r (@{$search->response()}) {
print "Search time :".$r->searchTime()."\n";
# returns an array ref of Result objects
# the same as the $search->results() method
map { print $_->URL()."\n"; } @{$r->resultElements()};
}
# Spelling interface
print $google->spelling(phrase=>"muntreal qwebec")->suggest(),"\n";
# Cache interface
my $cache = $google->cache(url=>"http://search.cpan.org/recent");
print $cache->get();

Provides a simple OOP-ish interface to the Google SOAP API

Valid arguments are :
String.
Boolean
Valid arguments are :
String. Google API key. If none is provided then the key passed to the parent Net::Google object will be used.
Int. First result number to display. Default is 0.
Int. Number of results to return. Default is 10.
String or array reference. Language restrictions.
String or array reference. Input encoding.
String or array reference. Output encoding.
Boolean.
Boolean.
Returns a Net::Google::Search object. Returns undef if there was an error.
String. Google API key. If none is provided then the key passed to the parent Net::Google object will be used.
String or array reference.
Int.If none is provided then the debug argument passed to the parent Net::Google object will be used.
Returns a Net::Google::Spelling object. Returns undef if there was an error.
Valid arguments are :
String. Google API key. If none is provided then the key passed to the parent Net::Google object will be used.
String.
Int.If none is provided then the debug argument passed to the parent Net::Google object will be used.
Returns a Net::Google::Cache object. Returns undef if there was an error.

0.53

$Date: 2003/02/22 16:48:52 $

Aaron Straup Cope

Marc Hedlund <marc@precipice.org>

http://aaronland.info/weblog/archive/4231

http://aaronland.net/weblog/archive/4204
This will probably happen around the time Hell freezes over so if you think you can do it faster, go nuts.

Please report all bugs via http://rt.cpan.org

Copyright (c) 2002-2003, Aaron Straup Cope. All Rights Reserved.
This is free software, you may use it and distribute it under the same terms as Perl itself.