Skip to content

Commit

Permalink
[SteamAppNewsBridge] Add tags filter (#3662)
Browse files Browse the repository at this point in the history
Undocumented tags filter discovered through /ISteamWebAPIUtil/GetSupportedAPIList/v1/
e.g. /ISteamNews/GetNewsForApp/v2/?appid=1091500&tags=patchnotes
  • Loading branch information
God-damnit-all authored Sep 11, 2023
1 parent 3178deb commit a9cf151
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions bridges/SteamAppNewsBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a9cf151

Please sign in to comment.