ifhub
/
ifnews
Archived
1
0
Fork 0

Чиним парсер инстеда

This commit is contained in:
Alexander Yakovlev 2020-09-18 16:13:03 +07:00
parent f98a9723ac
commit 147ac7d2cb
Signed by: oreolek
GPG Key ID: 1CDC4B7820C93BD3
1 changed files with 2 additions and 3 deletions

View File

@ -22,7 +22,6 @@ use \App\Models\Game;
use \App\Models\Platform;
use \App\Models\Language;
use \App\Models\Author;
use \App\Models\Tag;
use \App\Source;
use Log;
@ -62,9 +61,9 @@ class Instead extends Source {
$game = new Game;
$game->url = $url;
$text = trim($this->dom->filter('#panel')->text());
preg_match('/Дата: ([0-9]{4}\.[01][0-9]\.[0-3][0-9])/', $text, $matches);
preg_match('/Дата: ([0-9]{4}\.[01][0-9]\.[0-3][0-9]) /', $text, $matches);
$game->release_date = \DateTime::createFromFormat('Y.m.d', $matches[1]);
preg_match('/Автор: (.+)/', $text, $matches);
preg_match('/Автор: (.+) Дата/', $text, $matches);
$author = trim($matches[1]);
$game->title = trim($this->dom->filter('h2')->first()->text());
$game = $this->findGame($game);