From 3835f290c1fe2a1318e22039cbd003b2c733ee21 Mon Sep 17 00:00:00 2001 From: jaydeethree <34945248+jaydeethree@users.noreply.github.com> Date: Sun, 3 Aug 2025 15:14:51 -0700 Subject: [PATCH] Update GOGBridge to use GOG's REST API. I have tested this locally and it seems to work correctly. (#4616) --- bridges/GOGBridge.php | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/bridges/GOGBridge.php b/bridges/GOGBridge.php index eacff97f..ff713a96 100644 --- a/bridges/GOGBridge.php +++ b/bridges/GOGBridge.php @@ -9,20 +9,19 @@ class GOGBridge extends BridgeAbstract public function collectData() { - $values = getContents('https://www.gog.com/games/ajax/filtered?limit=25&sort=new'); + $values = getContents('https://catalog.gog.com/v1/catalog?limit=48&order=desc%3AstoreReleaseDate'); $decodedValues = json_decode($values); $limit = 0; foreach ($decodedValues->products as $game) { $item = []; - $item['author'] = $game->developer . ' / ' . $game->publisher; + $item['author'] = implode(', ', $game->developers) . ' / ' . implode(', ', $game->publishers); $item['title'] = $game->title; $item['id'] = $game->id; - $item['uri'] = self::URI . $game->url; + $item['uri'] = $game->storeLink; $item['content'] = $this->buildGameContentPage($game); - $item['timestamp'] = $game->globalReleaseDate; - foreach ($game->gallery as $image) { + foreach ($game->screenshots as $image) { $item['enclosures'][] = $image . '.jpg'; } @@ -42,18 +41,10 @@ class GOGBridge extends BridgeAbstract $gameDescriptionValue = json_decode($gameDescriptionText); $content = 'Genres: '; - $content .= implode(', ', $game->genres); + $content .= implode(', ', array_column($game->genres, 'name')); $content .= '
Supported Platforms: '; - if ($game->worksOn->Windows) { - $content .= 'Windows '; - } - if ($game->worksOn->Mac) { - $content .= 'Mac '; - } - if ($game->worksOn->Linux) { - $content .= 'Linux '; - } + $content .= implode(', ', $game->operatingSystems); $content .= '
' . $gameDescriptionValue->description->full;