Google-ISBNNumbers
view release on metacpan or search on metacpan
# $book_info now has keys for 'title', 'author_name',
# 'description','publication_date', and 'cover_link'
say $$book_info{title}; # says 'Modern Perl'
# DESCRIPTION
This module uses the Google Books API to retrieve basic information on a book by its
ISBN Number. The Google Books API seems to be more complete and reliable than other
resources for searching ISBN numbers.
You will need a Google API key from [https://console.cloud.google.com/apis/credentials](https://console.cloud.google.com/apis/credentials).
This requires setting up a basic 'Project' in that console, but no sensitive scopes are required,
so you should be able to get the key instantly. You can read up on the Google Books API
here: [https://developers.google.com/books](https://developers.google.com/books)
This should be one of the simplest modules you'll encounter. The synopsis above pretty
much covers it. You pass your Google API key to new() and you pass a valid ISBN number
to lookup\_isbn(), and you get back a key/value hash of basic info on your book.
FYI: The ISBN number should be found on the back cover, above the bar code, and
starts with '978'.
lib/Google/ISBNNumbers.pm view on Meta::CPAN
use strict;
use warnings;
our $VERSION = "1.00";
sub new {
my ($class, $google_api_key) = @_;
# the API key is required
croak "Google API Key is required to use Google::ISBNNumbers.\n".
"Please set up a key at https://console.cloud.google.com/apis/credentials" unless $google_api_key;
# become self, with an HTTP::Tiny and Cpanel::JSON objects
my $self = bless {
'api_key' => $google_api_key,
'http' => HTTP::Tiny->new,
'json_coder' => Cpanel::JSON::XS->new->utf8->allow_nonref->allow_blessed,
}, $class;
return $self;
}
lib/Google/ISBNNumbers.pm view on Meta::CPAN
# $book_info now has keys for 'title', 'author_name',
# 'description','publication_date', and 'cover_link'
say $$book_info{title}; # says 'Modern Perl'
=head1 DESCRIPTION
This module uses the Google Books API to retrieve basic information on a book by its
ISBN Number. The Google Books API seems to be more complete and reliable than other
resources for searching ISBN numbers.
You will need a Google API key from L<https://console.cloud.google.com/apis/credentials>.
This requires setting up a basic 'Project' in that console, but no sensitive scopes are required,
so you should be able to get the key instantly. You can read up on the Google Books API
here: L<https://developers.google.com/books>
This should be one of the simplest modules you'll encounter. The synopsis above pretty
much covers it. You pass your Google API key to new() and you pass a valid ISBN number
to lookup_isbn(), and you get back a key/value hash of basic info on your book.
FYI: The ISBN number should be found on the back cover, above the bar code, and
starts with '978'.
( run in 0.240 second using v1.01-cache-2.11-cpan-4d50c553e7e )