mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
1 line
720 B
PHP
1 line
720 B
PHP
<?php
|
|
require_once dirname(__FILE__) . '/../../www/config.php';
|
|
|
|
$titles = [];
|
|
|
|
$titles[] = 'Dack, Charles - Weather and Folk Lore of Peterborough and District (epub)';
|
|
$b = new Book();
|
|
|
|
foreach ($titles as $t)
|
|
{
|
|
$bookId = -2;
|
|
$book = $b->parseAuthor($t);
|
|
if ($book !== false)
|
|
{
|
|
echo 'Looking up: '.$book["author"].' - '.$book["title"].' ['.$t.']'."\n";
|
|
|
|
//check for existing book entry
|
|
$bookCheck = $b->getBookInfoByName($book["author"], $book["title"]);
|
|
|
|
if ($bookCheck === false)
|
|
{
|
|
//
|
|
// get from amazon
|
|
//
|
|
$ret = $b->updateBookInfo($book["author"], $book["title"]);
|
|
if ($ret !== false)
|
|
{
|
|
$bookId = $ret;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$bookId = $bookCheck["id"];
|
|
}
|
|
}
|
|
|
|
echo $bookId;
|
|
|
|
} |