From aa2bab8399b40c700a8d085134c45cfc8ad55f24 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Fri, 6 Apr 2018 10:45:58 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BB=D1=8C=D1=82=D1=80=20=D1=83?= =?UTF-8?q?=D0=BD=D0=B8=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8=20=D0=B4=D0=BB=D1=8F=20Itch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Itch.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Itch.php b/Source/Itch.php index 04671fc..56b74c7 100644 --- a/Source/Itch.php +++ b/Source/Itch.php @@ -6,6 +6,7 @@ use \Pandoc\Pandoc; class Itch extends Source { public $title = "Itch.io"; + public $games = []; protected function parse_tag($url) { $service = new \Sabre\Xml\Service(); $xml = $this->get_text($url); @@ -36,7 +37,7 @@ class Itch extends Source { $game->author = strip_tags($text->nextAll()->first()->html()); } }); - $this->output .= $game->print(); + $this->games[] = $game->print(); return $game; }, ]; @@ -46,7 +47,12 @@ class Itch extends Source { } protected function parse() { $this->parse_tag("https://itch.io/games/newest/tag-text-based.xml"); + $this->parse_tag("https://itch.io/games/newest/tag-twine.xml"); $this->parse_tag("https://itch.io/games/newest/tag-interactive-fiction.xml"); + $this->games = array_unique($this->games); + foreach ($this->games as $game) { + $this->output .= $game; + } } public function checkPage($url) { return (strpos($url,'.itch.io/') !== FALSE);