bookscanner
![Software License][ico-license]
, (*1)
Give Bookscanner a barcode or ISBN number, look it up via the OpenLibrary api (http://openlibrary.org/), and then return you a nice PHP array with relevant details., (*2)
Works with 10-digit or 13-digit ISBNs. It will happily take input from a text field that has been populated by a standard handheld barcode scanner. It will clean it up a little, validate the ISBN with its checksum, and then send a request to the excellent OpenLibrary API via cURL. It will parse the response, and it will return you a PHP array with all the available information., (*3)
For fields with more that one element, e.g., a book with several authors, the field will be returned as a comma-separated string., (*4)
Install
Via Composer, (*5)
``` bash
$ composer require imonroe/bookscanner, (*6)
## Usage
``` php
$isbn_data = imonroe\bookscanner\Bookscanner::get_isbn_data($isbn_string); // from a text input, presumably a scanned barcode
$isbn = $isbn_data['isbn']; // formatted ISBN number
$info_url = $isbn_data['info_url']; // OpenLibrary URL to information page
$title = $isbn_data['title']; // The title of the work
$subjects = $isbn_data['subjects']; // A string of subjects, separated by commas
$publisher = $isbn_data['publisher']; // The publisher of the work
$author = $isbn_data['author']; // The author. If there are multiple, this will be a comma-delimited string
$publication_date = $isbn_data['publication_date']; // The date the work was published
$number_of_pages =$isbn_data['number_of_pages']; // Number of pages
$physical_format =$isbn_data['physical_format']; // A string describing the physical format
$thumbnail_url = $isbn_data['thumbnail_url']; // A URL to OpenLibrary's cover thumbnail.
Change log
Please see CHANGELOG for more information on what has changed recently., (*7)
Testing
bash
$ composer test
, (*8)
Contributing
Please see CONTRIBUTING and CONDUCT for details., (*9)
Security
If you discover any security related issues, please email ian@ianmonroe.com instead of using the issue tracker., (*10)
Credits
License
The MIT License (MIT). Please see License File for more information., (*11)