get_text($url); $this->loadStr($text); unset($text); $this->dom->filter('.game')->each(function($gameBlock) { $date = trim($gameBlock->filter('.b .date b')->text()); $date = \DateTime::createFromFormat('Y.m.d', $date); $date = $date->format('U'); if ($date < $this->period) return; $game = new Game; $game->author = str_replace(trim($gameBlock->filter('span.author')->first()->text()), 'Автор: ', ''); $game->title = trim($gameBlock->filter('h2:first-child a:first-child')->first()->text()); $game->url = 'http://instead-games.ru/'.trim($gameBlock->filter('h2:first-child a:first-child')->first()->attr('href')); $this->output .= $game->print(); }); } protected function parse() { $this->insteadfeed("http://instead-games.ru/"); if (FORMAT === 'HTML') { $this->output .= "
Песочница
\n"; } elseif (FORMAT === 'MARKDOWN') { $this->output .= "##### Песочница\n"; } $this->insteadfeed("http://instead-games.ru/index.php?approved=0"); } }