diff --git a/src/Source/Axma.php b/src/Source/Axma.php new file mode 100644 index 0000000..aec2b19 --- /dev/null +++ b/src/Source/Axma.php @@ -0,0 +1,51 @@ +. +*/ +namespace Oreolek\Source; + +use \Oreolek\Game; +use \Oreolek\Source; + +class Axma extends Source { + public $title = "Библиотека AXMA (самая новая)"; + protected $games = array(); + protected $rootUrl = 'https://axma.info/library/'; + protected function parse() { + $i = 0; + // Дата выхода последней игры на странице + $lastDate = time(); + while ($lastDate >= $this->period) { + $text = $this->get_text('https://axma.info/library/?sort=last&from='.$i); + $this->loadStr($text); + unset($text); + $this->dom->filter("#listPubs h3 a")->each(function($link) { + $game = new Game; + $game->title = $link->text(); + $game->url = $link->attr('href'); + $game->url = str_replace('file', $this->rootUrl.'/comments.php?id=', $game->url); + $this->games[] = $game; + }); + // TODO парсер + // TODO выставить время последней игры в lastDate + $i += 5; + } + } + public function checkPage($url) { + return (strpos($url,$this->rootUrl) !== FALSE); + } +}