Update search to website changes #1
@@ -10,7 +10,13 @@ Place this in the composer.json.
|
|||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
Then execute
|
Then execute to get latest version:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
composer require techtube/bookinfo
|
||||||
|
```
|
||||||
|
|
||||||
|
or this to get specific version:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
composer require techtube/bookinfo:"1.0.4"
|
composer require techtube/bookinfo:"1.0.4"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ abstract class AbstractBookInfo
|
|||||||
public string $isbn;
|
public string $isbn;
|
||||||
public string $description;
|
public string $description;
|
||||||
public string $title;
|
public string $title;
|
||||||
|
public string $originalTitle;
|
||||||
public string $category;
|
public string $category;
|
||||||
public array $cover_url;
|
public array $cover_url;
|
||||||
public int $pages;
|
public int $pages;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class DataParser
|
|||||||
$info->isbn = $document->first('meta[property="books:isbn"]')->getAttribute('content');
|
$info->isbn = $document->first('meta[property="books:isbn"]')->getAttribute('content');
|
||||||
$info->description = trim($document->first('#book-description p')->text());
|
$info->description = trim($document->first('#book-description p')->text());
|
||||||
$info->title = trim($document->first('h1.book__title')->text());
|
$info->title = trim($document->first('h1.book__title')->text());
|
||||||
|
$info->originalTitle = trim($document->first("//*[contains(text(), 'Tytuł oryginału:')]", Query::TYPE_XPATH)?->nextSibling('dd')?->text() ?? '');
|
||||||
$info->category = trim($document->first('.book__category')->text());
|
$info->category = trim($document->first('.book__category')->text());
|
||||||
$info->cover_url = $this->generateCoverUrls(
|
$info->cover_url = $this->generateCoverUrls(
|
||||||
$document->first('meta[property="og:image"]')->getAttribute('content')
|
$document->first('meta[property="og:image"]')->getAttribute('content')
|
||||||
|
|||||||
Reference in New Issue
Block a user