mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[GameBananaBridge] Include update contents in feed (#4103)
* [GameBananaBridge] Include update contents in feed * [GameBananaBridge] Fix dynamic title property
This commit is contained in:
parent
4949900863
commit
6e2aeda61d
1 changed files with 7 additions and 1 deletions
|
@ -28,6 +28,8 @@ class GameBananaBridge extends BridgeAbstract
|
|||
return 'https://images.gamebanana.com/static/img/favicon/favicon.ico';
|
||||
}
|
||||
|
||||
private $title;
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
$url = 'https://api.gamebanana.com/Core/List/New?itemtype=Mod&page=1&gameid=' . $this->getInput('gid');
|
||||
|
@ -38,7 +40,7 @@ class GameBananaBridge extends BridgeAbstract
|
|||
$json_list = json_decode($api_response, true); // Get first page mod list
|
||||
|
||||
$url = 'https://api.gamebanana.com/Core/Item/Data?itemtype[]=Game&fields[]=name&itemid[]=' . $this->getInput('gid');
|
||||
$fields = 'name,Owner().name,text,screenshots,Files().aFiles(),date,Url().sProfileUrl(),udate';
|
||||
$fields = 'name,Owner().name,text,screenshots,Files().aFiles(),date,Url().sProfileUrl(),udate,Updates().aLatestUpdates()';
|
||||
foreach ($json_list as $element) { // Build api request to minimize API calls
|
||||
$mid = $element[1];
|
||||
$url .= '&itemtype[]=Mod&fields[]=' . $fields . '&itemid[]=' . $mid;
|
||||
|
@ -72,6 +74,10 @@ class GameBananaBridge extends BridgeAbstract
|
|||
foreach ($img_list as $img_element) {
|
||||
$item['content'] .= '<img src="https://images.gamebanana.com/img/ss/mods/' . $img_element['_sFile'] . '"/>';
|
||||
}
|
||||
if ($this->getInput('updates') && sizeof($element[8]) > 0) {
|
||||
$item['content'] .= '<br><strong>Update: ' . $element[8][0]['_sTitle'];
|
||||
$item['content'] .= '</strong><br>' . $element[8][0]['_sText'] . '<hr>';
|
||||
}
|
||||
$item['content'] .= '<br>' . $element[2];
|
||||
|
||||
$item['uid'] = $item['uri'] . $item['title'] . $item['timestamp'];
|
||||
|
|
Loading…
Add table
Reference in a new issue