Archived
1
0
Fork 0

catch GJ exceptions and skip "coming soon" (Steam)

This commit is contained in:
Alexander Yakovlev 2018-09-14 11:50:14 +07:00
parent 1c05d85011
commit bd2edde52c
2 changed files with 17 additions and 8 deletions

View file

@ -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) {}
}
}

View file

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