set source_id on instory games
This commit is contained in:
parent
ca892c3875
commit
c0e7069e67
|
@ -42,7 +42,11 @@ class Instory extends Source {
|
|||
$this->dom->filter('.container .at-card')->each(functioN($gameBlock) {
|
||||
$game = new Game;
|
||||
$game->title = trim($gameBlock->filter('h5')->text());
|
||||
$game->url = 'https://instory.su'.trim($gameBlock->filter('h5 a')->attr('href'));
|
||||
$url = trim($gameBlock->filter('h5 a')->attr('href'));
|
||||
$game->url = 'https://instory.su'.$url;
|
||||
if (strpos($url, '/story/') !== false) {
|
||||
$game->source_id = (int) str_replace('/story/', '', $url);
|
||||
}
|
||||
$game->description = trim($gameBlock->filter('.post-card__excerpt')->html());
|
||||
$game->release_date = $this->downloader->convertDate($gameBlock->filter('.at-author__extend span')->text());
|
||||
$game = $this->findGame($game);
|
||||
|
|
Reference in a new issue