mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-05 08:07:33 +02:00
Update GOGBridge to use GOG's REST API. I have tested this locally and it seems to work correctly. (#4616)
This commit is contained in:
@@ -9,20 +9,19 @@ class GOGBridge extends BridgeAbstract
|
|||||||
|
|
||||||
public function collectData()
|
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);
|
$decodedValues = json_decode($values);
|
||||||
|
|
||||||
$limit = 0;
|
$limit = 0;
|
||||||
foreach ($decodedValues->products as $game) {
|
foreach ($decodedValues->products as $game) {
|
||||||
$item = [];
|
$item = [];
|
||||||
$item['author'] = $game->developer . ' / ' . $game->publisher;
|
$item['author'] = implode(', ', $game->developers) . ' / ' . implode(', ', $game->publishers);
|
||||||
$item['title'] = $game->title;
|
$item['title'] = $game->title;
|
||||||
$item['id'] = $game->id;
|
$item['id'] = $game->id;
|
||||||
$item['uri'] = self::URI . $game->url;
|
$item['uri'] = $game->storeLink;
|
||||||
$item['content'] = $this->buildGameContentPage($game);
|
$item['content'] = $this->buildGameContentPage($game);
|
||||||
$item['timestamp'] = $game->globalReleaseDate;
|
|
||||||
|
|
||||||
foreach ($game->gallery as $image) {
|
foreach ($game->screenshots as $image) {
|
||||||
$item['enclosures'][] = $image . '.jpg';
|
$item['enclosures'][] = $image . '.jpg';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,18 +41,10 @@ class GOGBridge extends BridgeAbstract
|
|||||||
$gameDescriptionValue = json_decode($gameDescriptionText);
|
$gameDescriptionValue = json_decode($gameDescriptionText);
|
||||||
|
|
||||||
$content = 'Genres: ';
|
$content = 'Genres: ';
|
||||||
$content .= implode(', ', $game->genres);
|
$content .= implode(', ', array_column($game->genres, 'name'));
|
||||||
|
|
||||||
$content .= '<br />Supported Platforms: ';
|
$content .= '<br />Supported Platforms: ';
|
||||||
if ($game->worksOn->Windows) {
|
$content .= implode(', ', $game->operatingSystems);
|
||||||
$content .= 'Windows ';
|
|
||||||
}
|
|
||||||
if ($game->worksOn->Mac) {
|
|
||||||
$content .= 'Mac ';
|
|
||||||
}
|
|
||||||
if ($game->worksOn->Linux) {
|
|
||||||
$content .= 'Linux ';
|
|
||||||
}
|
|
||||||
|
|
||||||
$content .= '<br />' . $gameDescriptionValue->description->full;
|
$content .= '<br />' . $gameDescriptionValue->description->full;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user