[SteamAppNewsBridge] Add tags filter (#3662)

Undocumented tags filter discovered through /ISteamWebAPIUtil/GetSupportedAPIList/v1/
e.g. /ISteamNews/GetNewsForApp/v2/?appid=1091500&tags=patchnotes
This commit is contained in:
ImportTaste 2023-09-10 20:35:09 -05:00 committed by GitHub
parent 3178deb5a8
commit a9cf1512e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 5 deletions

View File

@ -27,18 +27,26 @@ class SteamAppNewsBridge extends BridgeAbstract
'title' => '# of posts to retrieve (default 20)',
'type' => 'number',
'defaultValue' => 20
],
'tags' => [
'name' => 'Tag Filter',
'title' => 'Comma-separated list of tags to filter by',
'type' => 'text',
'exampleValue' => 'patchnotes'
]
]];
public function collectData()
{
$api = 'https://api.steampowered.com/ISteamNews/GetNewsForApp/v2/';
$apiTarget = 'https://api.steampowered.com/ISteamNews/GetNewsForApp/v2/';
// Example with params: https://api.steampowered.com/ISteamNews/GetNewsForApp/v2/?appid=730&maxlength=0&count=20
// More info at dev docs https://partner.steamgames.com/doc/webapi/ISteamNews
$url = $api . '?appid='
. $this->getInput('appid') . '&maxlength='
. $this->getInput('maxlength') . '&count='
. $this->getInput('count');
$url =
$apiTarget
. '?appid=' . $this->getInput('appid')
. '&maxlength=' . $this->getInput('maxlength')
. '&count=' . $this->getInput('count')
. '&tags=' . $this->getInput('tags');
// Get the JSON content
$json = getContents($url);