Archived
1
0
Fork 0

Даты для игр INSTEAD

This commit is contained in:
Alexander Yakovlev 2018-04-07 18:06:05 +07:00
parent 5acb536617
commit 6b005fb6a9

View file

@ -40,10 +40,10 @@ class Instead extends Source {
unset($text);
$game = new Game;
$game->url = $url;
$game->platform = 'INSTEAD';
$text = trim($this->dom->filter('#panel')->text());
preg_match('/Дата: ([0-9]{4}\.[01][0-9]\.[0-3][0-9])Размер/', $text, $matches);
$date = \DateTime::createFromFormat('Y.m.d', $matches[1]);
$date = $date->format('U');
$game->date = \DateTime::createFromFormat('Y.m.d', $matches[1]);
preg_match('/Автор: (.+)Дата/', $text, $matches);
$game->author = trim($matches[1]);
$game->title = trim($this->dom->filter('h2')->first()->text());