'January', 'Февраля' => 'February', 'Марта' => 'March', 'Апреля' => 'April', 'Мая' => 'May', 'Июня' => 'June', 'Июля' => 'July', 'Августа' => 'August', 'Сентября' => 'September', 'Октября' => 'October', 'Ноября' => 'November', 'Декабря' => 'December', ]; protected function parse() { $text = $this->get_text('http://anivisual.net/stuff/1'); $this->loadStr($text); unset($text); $this->dom->filter('.entryBlock')->each(function($gameBlock) { $date = trim($gameBlock->filter('.icon-calendar')->text()); foreach ($this->months as $ruM => $enM) { $date = str_replace($ruM, $enM, $date); } $date = \DateTime::createFromFormat('d F Y', $date); $date = $date->format('U'); if ($date < $this->period) return; $game = new Game; $link = $gameBlock->filter('.novel-ttl a')->first(); $game->title = htmlspecialchars_decode($link->innerHtml); $game->url = 'http://anivisual.net'.$link->getAttribute('href'); $game->description = $gameBlock->filter('span')->first()->text(); $games[] = $game; $this->output .= $game->print(); }); } public function checkPage($url) { return (strpos($url,'http://anivisual.net/stuff/') !== FALSE); } public function page($url) { $text = $this->get_text($url); $this->loadStr($text); unset($text); $game = new Game; $game->url = $url; $gameBlock = $this->dom->filter('#casing-box'); $date = trim($gameBlock->filter('.icon-calendar')->first()->text()); if (!empty($date)) { foreach ($this->months as $ruM => $enM) { $date = str_replace($ruM, $enM, $date); } $game->date = \DateTime::createFromFormat('d F Y', $date); unset($date); } $game->title = htmlspecialchars_decode($gameBlock->filter('h1.logo')->text()); $game->description = $this->dom->filter('#content > section > span')->text(); return $game; } }