From 05f4e3267f7ad64449d3f93652f73f60af6b7a0b Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Thu, 8 Aug 2019 16:26:50 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D1=8F=D0=BC=D0=BE=D0=B9=20=D0=BF?= =?UTF-8?q?=D0=B0=D1=80=D1=81=D0=B8=D0=BD=D0=B3=20=D0=9A=D0=B2=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B1=D1=83=D0=BA=D0=B0=20-=20=D0=B8=D0=BD=D1=82=D0=B5?= =?UTF-8?q?=D1=80=D1=84=D0=B5=D0=B9=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Source/Questbook.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Source/Questbook.php b/src/Source/Questbook.php index 3886601..a21e643 100644 --- a/src/Source/Questbook.php +++ b/src/Source/Questbook.php @@ -23,10 +23,19 @@ use \Oreolek\Source; class Questbook extends Source { public $title = "Сторигеймы"; + protected function parse() { - $this->parseFeed('https://quest-book.ru/directory/rss/'); - $this->parseFeed('https://quest-book.ru/online/rss.xml'); + global $argv; + if (isset($argv[2])) { + $game_page = $this->get_text($argv[2]); + $this->loadStr($game_page, []); + $this->output .= $this->page($argv[2])->print(); + } else { + $this->parseFeed('https://quest-book.ru/directory/rss/'); + $this->parseFeed('https://quest-book.ru/online/rss.xml'); + } } + protected function parseFeed($feedUrl) { $string = $this->get_text($feedUrl); $string = mb_convert_encoding($string, 'UTF-8', 'auto'); @@ -59,9 +68,11 @@ class Questbook extends Source { $this->output .= $game->print(); } } + public function checkPage($url) { return (strpos($url,'https://quest-book.ru/') !== FALSE); } + public function page($url) { $game = new Game; $game->url = $url;