ifhub
/
ifnews
Archived
1
0
Fork 0

Описания игр Аперо

This commit is contained in:
Alexander Yakovlev 2020-06-10 16:58:04 +07:00
parent d7299d8923
commit 6038b42459
1 changed files with 12 additions and 1 deletions

View File

@ -117,7 +117,18 @@ class Apero extends Source {
if (!empty($date)) {
$game->release_date = \DateTime::createFromFormat('Y-m-d', $date);
}
// TODO description
$ddblock = $this->dom->filter('dt')->reduce(function($block){
return ($block->text() === 'Описание:');
});
if (!empty($ddblock) && $ddblock->count() > 0) {
$ddblock = $ddblock->first()->nextAll('dd');
if (!empty($ddblock) && $ddblock->count() > 0) {
$ddblock = $ddblock->first()->filter('div')->first();
$game->description = $ddblock->html();
}
}
$game->save();
$this->dom->filter('dd a')->reduce(function($block){