Php queries the example of books on the amazon website based on the isbn account. Plug-in description: based on the provided 10-digit ISBN number, the plug-in searches for detailed information about the book on the Amazon website. If the result is found, an array of two elements is returned. The first Metadatabase description:
Based on the provided ten-digit ISBN book number, the plug-in searches for detailed information about the book on the Amazon website.
If the result is found, an array of two elements is returned. The first element is the title of the book, and the second element is the URL address of the thumbnail of the book cover.
It requires the following parameters: $ ISBN 10-bit ISBN book number
The code is as follows:
$ Isbn = '007149216x ';
$ Result = PIPHP_GetBookFromISBN ($ isbn );
If (! $ Result) echo "cocould not find title for ISBN '$ isbn '.";
Else echo"$ Result [0] ";
Function PIPHP_GetBookFromISBN ($ isbn)
{
// Plug-in 93: Get Book From ISBN
//
// This plug-in looks up an ISBN-10 at Amazon.com and then
// Returns the matching book title and a thumbnail image
// Of the front cover. It requires this argument:
//
// $ Isbn: The ISBN to look up
//
// Updated from the function in the book to take
// Account changes to the Amazon HTML.
$ Find =' $ Img = 'http: // ecx.images-amazon.com/images/ I ';
$ Page = @ file_get_contents ($ url );
If (! Strlen ($ page) return array (FALSE );
$ Ptr1 = strpos ($ page, $ find) + strlen ($ find );
If (! $ Ptr1) return array (FALSE );
$ Ptr2 = strpos ($ page, '"/>', $ ptr1 );
$ Title = substr ($ page, $ ptr1, $ ptr2-$ ptr1 );
$ Find = $ img;
$ Ptr1 = strpos ($ page, $ find) + strlen ($ find );
$ Ptr2 = strpos ($ page, '"', $ ptr1 );
$ Image = substr ($ page, $ ptr1, $ ptr2-$ ptr1 );
Return array ($ title, $ img. $ image );
}
Based on the provided 10 ISBN book numbers, the Lightning plug-in searches for detailed information about the book on the Amazon website. If the result is found, an array of two elements is returned, the first element...