diff --git a/Source/Instead.php b/Source/Instead.php index 7da3c4d..f388cec 100644 --- a/Source/Instead.php +++ b/Source/Instead.php @@ -30,4 +30,20 @@ class Instead extends Source { } $this->insteadfeed("http://instead-games.ru/index.php?approved=0"); } + public function checkPage($url) { + return (strpos($url,'http://instead-games.ru/game.php') !== FALSE); + } + public function page($url) { + echo 'Распознана игра INSTEAD.'.PHP_EOL; + $text = $this->get_text($url); + $this->loadStr($text); + unset($text); + $game = new Game; + $game->url = $url; + preg_match('/\s([0-9]{4}\.[01][0-9]\.[0-3][0-9])\s/', $this->dom->filter('#panel')->text(), $matches); + $date = \DateTime::createFromFormat('Y.m.d', $matches[0]); + $date = $date->format('U'); + $game->author = str_replace(trim($gameBlock->filter('span.author')->first()->text()), 'Автор: ', ''); + $game->title = trim($gameBlock->filter('h2')->first()->text()); + } }