steam and gamejolt fixes
This commit is contained in:
parent
3bcd32c5ad
commit
fe45c2a2a2
|
@ -8,6 +8,7 @@ class Gamejolt extends Source {
|
|||
protected function parse_tag($url) {
|
||||
$data = json_decode($this->get_text($url));
|
||||
$games = $data->payload->games;
|
||||
if (count($games) > 0) {
|
||||
foreach ($games as $gameData) {
|
||||
$descUrl = 'https://gamejolt.com/site-api/web/discover/games/overview/'.$gameData->id;
|
||||
$descData = json_decode($this->get_text($descUrl));
|
||||
|
@ -23,6 +24,7 @@ class Gamejolt extends Source {
|
|||
$this->output .= $game->print();
|
||||
}
|
||||
}
|
||||
}
|
||||
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");
|
||||
|
|
|
@ -27,13 +27,12 @@ class Steam extends Source {
|
|||
foreach ($games as $gameLink) {
|
||||
$url = $gameLink->getAttribute('href');
|
||||
$url = substr($url,0,strpos($url, '?')); // remove query string
|
||||
game = new Game;
|
||||
$game = new Game;
|
||||
$game->url = $url;
|
||||
try {
|
||||
$text = $this->get_text($url);
|
||||
$this->dom = new Dom;
|
||||
$this->dom->loadStr($text, []);
|
||||
var_dump($text);
|
||||
unset($text);
|
||||
$name = $this->dom->find('div.apphub_AppName');
|
||||
$description = $this->dom->find('meta[property=og:description]');
|
||||
|
|
Reference in a new issue