Update search to website changes #1

Merged
krzysiej merged 4 commits from feature/update-to-website-changes into master 2025-10-03 15:21:57 +02:00
3 changed files with 9 additions and 1 deletions
Showing only changes of commit 171c050368 - Show all commits

View File

@@ -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"

View File

@@ -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;

View File

@@ -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')