Описания игр Аперо
This commit is contained in:
parent
d7299d8923
commit
6038b42459
|
@ -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){
|
||||
|
|
Reference in New Issue