mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-29 11:58:23 +01:00
[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:
parent
3178deb5a8
commit
a9cf1512e7
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user