Чиним парсер инстеда
This commit is contained in:
parent
f98a9723ac
commit
147ac7d2cb
|
@ -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);
|
||||
|
|
Reference in New Issue