Instead WIP
This commit is contained in:
parent
4b9db5ac0c
commit
439f66380c
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue