NAME
WWW::Google::CustomSearch::Result - Placeholder for Google JSON/Atom Custom Search Result.
VERSION
Version 0.12
DESCRIPTION
Provides the interface to the individual search results based on the search criteria.
METHODS
kind()
Returns the 'kind' attribute of the search result.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
print "Kind: ", $result->kind, "\n";
formattedTotalResults()
Returns the 'formattedTotalResults' attribute of the search result.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
print "Formatted Total Results: ", $result->formattedTotalResults, "\n";
formattedSearchTime()
Returns the 'formattedSearchTime' attribute of the search result.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
print "Formatted Search Time: ", $result->formattedSearchTime, "\n";
totalResults()
Returns the 'totalResults' attribute of the search result.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
print "Total Results: ", $result->totalResults, "\n";
searchTime()
Returns the 'searchTime' attribute of the search result.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
print "Search Time: ", $result->searchTime, "\n";
url_template()
Returns the URL template attribute of the search result.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
print "URL Template: ", $result->url_template, "\n";
url_type()
Returns the URL Type attribute of the search result.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
print "URL Type: ", $result->url_type, "\n";
request()
Returns the request WWW::Google::CustomSearch::Request object used in the last search.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
my $request = $result->request;
nextPage()
Returns the next page WWW::Google::CustomSearch::Page object which can be used to fetch the next page result.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
my $page = $result->nextPage;
previousPage()
Returns the previous page WWW::Google::CustomSearch::Page object which can be used to fetch the previous page result.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx, start => 2);
my $result = $engine->search("Google");
my $page = $result->previousPage;
items()
Returns list of search item WWW::Google::CustomSearch::Item based on the search criteria.
use strict; use warnings;
use WWW::Google::CustomSearch;
my $api_key = 'Your_API_Key';
my $cx = 'Search_Engine_Identifier';
my $engine = WWW::Google::CustomSearch->new(api_key => $api_key, cx => $cx);
my $result = $engine->search("Google");
my $items = $result->items; # ArrayRef
my @items = $result->items; # Array
AUTHOR
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
BUGS
Please report any bugs or feature requests to bug-www-google-customsearch at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Google-CustomSearch. I will be notified and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc WWW::Google::CustomSearch::Result
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Google-CustomSearch
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
LICENSE AND COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
DISCLAIMER
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.