Archived
1
0
Fork 0

set source_id on instory games

This commit is contained in:
Alexander Yakovlev 2020-04-19 14:10:49 +07:00
parent ca892c3875
commit c0e7069e67
Signed by: oreolek
GPG key ID: 1CDC4B7820C93BD3

View file

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