mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 17:28:55 +00:00
1 line
1.5 KiB
PHP
1 line
1.5 KiB
PHP
<?php
|
|
require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
|
|
require_once (NN_LIBS . DS . 'AmazonProductAPI.php');
|
|
|
|
use newznab\controllers\Books;
|
|
use newznab\db\Settings;
|
|
|
|
$b = new Books();
|
|
|
|
|
|
$s = new Settings();
|
|
|
|
$title = "Long Arm, The - Franz Habl ";
|
|
|
|
$obj = new AmazonProductAPI($s->getSetting('amazonpubkey'), $s->getSetting('amazonprivkey'), $s->getSetting('amazonassociatetag'));
|
|
|
|
try
|
|
{
|
|
$amaz = $obj->searchProducts($title, AmazonProductAPI::BOOKS, "TITLE");
|
|
|
|
$item = [];
|
|
$item["asin"] = (string)$amaz->Items->Item->ASIN;
|
|
$item["url"] = (string)$amaz->Items->Item->DetailPageURL;
|
|
$item["cover"] = (string)$amaz->Items->Item->LargeImage->URL;
|
|
$item["author"] = (string)$amaz->Items->Item->ItemAttributes->Author;
|
|
$item["dewey"] = (string)$amaz->Items->Item->ItemAttributes->DeweyDecimalNumber;
|
|
$item["ean"] = (string)$amaz->Items->Item->ItemAttributes->EAN;
|
|
$item["isbn"] = (string)$amaz->Items->Item->ItemAttributes->ISBN;
|
|
$item["publisher"] = (string)$amaz->Items->Item->ItemAttributes->Publisher;
|
|
$item["publishdate"] = (string)$amaz->Items->Item->ItemAttributes->PublicationDate;
|
|
$item["pages"] = (string)$amaz->Items->Item->ItemAttributes->NumberOfPages;
|
|
$item["title"] = (string)$amaz->Items->Item->ItemAttributes->Title;
|
|
|
|
$item["review"] = '';
|
|
if (isset($amaz->Items->Item->EditorialReviews)) {
|
|
$item["review"] = trim(strip_tags((string)$amaz->Items->Item->EditorialReviews->EditorialReview->Content));
|
|
}
|
|
|
|
print_r($item);
|
|
}
|
|
catch(Exception $e)
|
|
{
|
|
echo "failed";
|
|
} |