WWW::Google::CustomSearch::Result - Placeholder for Google JSON/Atom Custom Search Result.
Version 0.11
Provides the interface to the individual search results based on the search criteria.
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";
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";
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";
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";
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";
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";
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";
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;
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;
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;
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
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
<mohammad.anwar at yahoo.com>
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.
bug-www-google-customsearch at rt.cpan.org
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
http://annocpan.org/dist/WWW-Google-CustomSearch
CPAN Ratings
http://cpanratings.perl.org/d/WWW-Google-CustomSearch
Search CPAN
http://search.cpan.org/dist/WWW-Google-CustomSearch/
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.
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.
To install WWW::Google::CustomSearch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Google::CustomSearch
CPAN shell
perl -MCPAN -e shell install WWW::Google::CustomSearch
For more information on module installation, please visit the detailed CPAN module installation guide.