diff --git a/Source/Gamejolt.php b/Source/Gamejolt.php index a2448cf..6b2dcb4 100644 --- a/Source/Gamejolt.php +++ b/Source/Gamejolt.php @@ -47,9 +47,11 @@ class Gamejolt extends Source { } } protected function parse() { - $this->parse_tag("https://gamejolt.com/site-api/web/library/games/tag/twine"); - $this->parse_tag("https://gamejolt.com/site-api/web/library/games/tag/renpy"); - $this->parse_tag("https://gamejolt.com/site-api/web/library/games/tag/text"); - $this->parse_tag("https://gamejolt.com/site-api/web/library/games/tag/ascii"); + try { + $this->parse_tag("https://gamejolt.com/site-api/web/library/games/tag/twine"); + $this->parse_tag("https://gamejolt.com/site-api/web/library/games/tag/renpy"); + $this->parse_tag("https://gamejolt.com/site-api/web/library/games/tag/text"); + $this->parse_tag("https://gamejolt.com/site-api/web/library/games/tag/ascii"); + } catch (\Exception $e) {} } } diff --git a/Source/Steam.php b/Source/Steam.php index 146402f..40ecf16 100644 --- a/Source/Steam.php +++ b/Source/Steam.php @@ -56,11 +56,13 @@ class Steam extends Source { $url = $gameLink->attr('href'); $url = substr($url,0,strpos($url, '?')); // remove query string $game = $this->page($url); - if ($game->date) { - $date = $game->date->format('U'); - if ($date < $this->period) return; + if ($game) { + if ($game->date) { + $date = $game->date->format('U'); + if ($date < $this->period) return; + } + $this->games[] = $game->print(); } - $this->games[] = $game->print(); }); } protected function parse() { @@ -103,6 +105,11 @@ class Steam extends Source { $game = new Game; $game->url = $url; + $comingsoon = $this->dom->filter('div.game_area_comingsoon')->first(); + if ($comingsoon->count() > 0) { + // we are skipping preorders and coming soon games + return false; + } $title = $this->dom->filter('div.apphub_AppName')->first(); if ($title->count() > 0) { $game->title = trim($title->text());