Archived
1
0
Fork 0

Улучшения парсера INSTEAD

This commit is contained in:
Alexander Yakovlev 2018-04-07 18:04:12 +07:00
parent 408622afea
commit 5acb536617

View file

@ -53,7 +53,14 @@ class Instead extends Source {
$game->url_online_description = 'Играть онлайн';
}
$game->url_download = $this->baseUrl.ltrim($this->dom->selectLink('Скачать')->first()->attr('href'), '/');
$game->url_discussion = $this->dom->selectLink('Обсудить')->first()->attr('href');
$link = $this->dom->selectLink('Обсудить')->first();
if ($link->count() > 0) {
$game->url_discussion = $link->attr('href');
}
$image = $this->dom->filter('#screenshots a')->first();
if ($image->count() > 0) {
$game->image = $this->baseUrl.$image->attr('href');
}
return $game;
}
}