php根据isbn书号查询amazon网站上的图书信息的示例
这篇文章主要介绍了php根据isbn书号查询amazon网站上的图书信息的示例,需要的朋友可以参考下
插件说明:
插件根据提供的10位ISBN书号,在Amazon网站上查找该图书的详细信息。
如果找到结果,则返回一个两元素的数组,其中第一个元素是书的标题,,而第二个元素是该书封面缩写图的URL地址。
它需要以下参数:$ISBN 10位ISBN书号
复制代码 代码如下:
$isbn = '007149216X';
$result = PIPHP_GetBookFromISBN($isbn);
if (!$result) echo "Could 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 into
// 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);
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Amazon Asin refers to Amazon's standard identification number, which is a special coding identifier for Amazon products. It is a unique number used by Amazon to identify all products on its market. ASINs are an important part of Amazon's search functionality, meaning that whether customers are searching by category or product name, the exact product they are looking for can be returned.

With the continuous development of Internet technology, the requirements for the performance and stability of website applications are becoming higher and higher. Traditional back-end databases are also unable to handle large data, low latency and high concurrency. In order to improve site performance, many websites are now beginning to use caching technology, and Amazon ElastiCache is a very popular caching solution. 1. What is Amazon ElastiCache? AmazonElastiCache is a distribution

The Xiaomi 14T series will be getting announced tomorrow, September 26, and there have been not a few leaks about the device including a report that the phones will not ship with a charger in the box. However, a new accidental leak by a partner retai

Samsung's Odyssey gaming monitor line-up features some of the best gaming monitors money can buy, often delivering on top-tier features and specifications along with their flagship pricing. The Odyssey Neo G8 sits at the higher end of Samsung's Odyss

Amazon Fire tablets often come with a plethora of annoying restrictions, but XDA Developers forum member Datastream33 has created an all-in-one solution that can help users get around those. The tool is called Fire Toolbox, and is available for Windo

Amazon is currently offering the 77-inch Samsung S90C OLED for just $1,899 including free shipping. According to Camel's price tracker, this is the lowest price ever listed by the American e-commerce behemoth. This sale provides a substantial 44% dis

Samsung is currently running its Gaming Week sale event, discounting many of its top-notch gaming monitors from the Odyssey series. One such monitor, the Samsung Odyssey G85SB OLED (model LS34BG850SNXZA), is heavily discounted for the duration of the

Many regular living rooms might be a tad too small for an enormous 85-inch TV such as the latest Hisense U8N. However, for demanding home theater fans who value immersion over anything else, this particular TV size is probably the best choice since e
