|
NAMEREST::Google::Search - OO interface to Google Search API SYNOPSIS use REST::Google::Search;
REST::Google::Search->http_referer('http://example.com');
my $res = REST::Google::Search->new(
q => 'Larry Wall',
);
die "response status failure" if $res->responseStatus != 200;
my $data = $res->responseData;
my $cursor = $data->cursor;
my $pages = $cursor->pages;
printf "current page index: %s\n", $cursor->currentPageIndex;
printf "estimated result count: %s\n", $cursor->estimatedResultCount;
my @results = $data->results;
foreach my $r (@results) {
printf "\n";
printf "title: %s\n", $r->title;
printf "url: %s\n", $r->url;
}
DESCRIPTION"REST::Google::Search" provides OO interface to Google REST (aka AJAX) API for searching. METHODS
CLASSES"REST::Google::Search" contains dedicated classes for each of supported search services. You may use them instead of specifying certain service with "service" class method. E.g: use REST::Google::Search::Blogs;
# ...
# set referer, etc
my $r = REST::Google::Search::Blogs->new( q => 'foobar' );
is the same as: use REST::Google::Search qw/BLOGS/;
REST::Google::Search->service( BLOGS );
# ...
# set referer, etc
my $r = REST::Google::Search->new( q => 'foobar' );
Available classes: SEE ALSOREST::Google - the base class for this module; <http://code.google.com/apis/ajaxsearch/documentation/#fonje> - brief information about Google Search AJAX API in non-Javascript environments; <http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje> - Google Search AJAX API documentation; Google::Search - high-level class for Google Search AJAX API; LICENSE AND COPYRIGHTCopyright 2008, Eugen Sobchenko <ejs@cpan.org> and Sergey Sinkovskiy <glorybox@cpan.org> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|