get_text('http://apero.ru/Текстовые-игры/Песочница'); $text = mb_convert_encoding($text, 'UTF-8', 'auto'); $this->loadStr($text); $this->parseIndex(); $text = $this->get_text('http://apero.ru/Текстовые-игры'); $text = mb_convert_encoding($text, 'UTF-8', 'auto'); $this->loadStr($text); $this->parseIndex(); } protected function parseIndex() { $this->dom->filter('.tabled-game-block')->each(function($gameBlock){ $formatter = new \IntlDateFormatter( 'ru', \IntlDateFormatter::LONG, \IntlDateFormatter::NONE ); $date = trim($gameBlock->filter('.game-updated-block')->text(), "() \t\n\r\0\x0B"); $date = $formatter->parse($date); if ($date < $this->period) return; $game = new Game; $game->author = trim($gameBlock->filter('.game-author-block:first-child a')->text()); $game->title = trim($gameBlock->find('h2:first-child a:first-child')->first()->text()); $game->url = trim($gameBlock->find('h2:first-child a:first-child')->first()->getAttribute('href')); $game->description = trim($gameBlock->find('.game-desc-block')->first()->text()); $this->output .= $game->print(); }); } }