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);