WWW::Google::CustomSearch::Item - Placeholder for Google JSON/Atom Custom Search Item.
Version 0.11
Returns the 'kind' attribute of the 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"); foreach my $item ($result->items) { print "Item Kind: ", $item->kind, "\n" if defined $item->kind; }
Returns the 'link' attribute of the 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"); foreach my $item ($result->items) { print "Item Link: ", $item->link, "\n" if defined $item->link; }
Returns the 'displayLink' attribute of the 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"); foreach my $item ($result->items) { print "Item Display Link: ", $item->displayLink, "\n" if defined $item->displayLink; }
Returns the 'snippet' attribute of the 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"); foreach my $item ($result->items) { print "Item Snippet: ", $item->snippet, "\n" if defined $item->snippet; }
Returns the 'htmlSnippet' attribute of the 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"); foreach my $item ($result->items) { print "Item HTML Snippet: ", $item->htmlSnippet, "\n" if defined $item->htmlSnippet; }
Returns the 'cacheId' attribute of the 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"); foreach my $item ($result->items) { print "Item Cache Id: ", $item->cacheId, "\n" if defined $item->cacheId; }
Returns the 'formattedUrl' attribute of the 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"); foreach my $item ($result->items) { print "Item Formatted URL: ", $item->formattedUrl, "\n" if defined $item->formattedUrl; }
Returns the 'htmlFormattedUrl' attribute of the 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"); foreach my $item ($result->items) { print "Item HTML Formatted URL: ", $item->htmlFormattedUrl, "\n" if defined $item->htmlFormattedUrl; }
Returns the 'title' attribute of the 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"); foreach my $item ($result->items) { print "Item Title: ", $item->title, "\n" if defined $item->title; }
Returns the 'htmlTitle' attribute of the 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"); foreach my $item ($result->items) { print "Item HTML Title: ", $item->htmlTitle, "\n" if defined $item->htmlTitle; }
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::Item
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.