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
|
||||
composer require techtube/bookinfo:"1.0.4"
|
||||
|
||||
@@ -9,6 +9,7 @@ abstract class AbstractBookInfo
|
||||
public string $isbn;
|
||||
public string $description;
|
||||
public string $title;
|
||||
public string $originalTitle;
|
||||
public string $category;
|
||||
public array $cover_url;
|
||||
public int $pages;
|
||||
|
||||
@@ -25,6 +25,7 @@ class DataParser
|
||||
$info->isbn = $document->first('meta[property="books:isbn"]')->getAttribute('content');
|
||||
$info->description = trim($document->first('#book-description p')->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->cover_url = $this->generateCoverUrls(
|
||||
$document->first('meta[property="og:image"]')->getAttribute('content')
|
||||
|
||||
Reference in New Issue
Block a user