mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-29 14:48:52 +03:00
[RedditBridge] Search for specific flairs (#3067)
* flair filter * syntax * fix multi & user feeds * ' * dont replace ,
This commit is contained in:
parent
8dcc21a871
commit
30d964b356
1 changed files with 17 additions and 0 deletions
|
@ -41,6 +41,12 @@ class RedditBridge extends BridgeAbstract
|
|||
'required' => true,
|
||||
'exampleValue' => 'selfhosted',
|
||||
'title' => 'SubReddit name'
|
||||
],
|
||||
'f' => [
|
||||
'name' => 'Flair',
|
||||
'required' => false,
|
||||
'exampleValue' => 'Proxy',
|
||||
'title' => 'Flair filter'
|
||||
]
|
||||
],
|
||||
'multi' => [
|
||||
|
@ -136,11 +142,22 @@ class RedditBridge extends BridgeAbstract
|
|||
$keywords = '';
|
||||
}
|
||||
|
||||
if (!($this->getInput('f') === '') && $this->queriedContext == 'single') {
|
||||
$flair = $this->getInput('f');
|
||||
$flair = str_replace(' ', '%20', $flair);
|
||||
$flair = 'flair%3A%22' . $flair . '%22%20';
|
||||
} else {
|
||||
$flair = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($subreddits as $subreddit) {
|
||||
$name = trim($subreddit);
|
||||
$values = getContents(self::URI
|
||||
. '/search.json?q='
|
||||
. $keywords
|
||||
. $flair
|
||||
. ($user ? 'author%3A' : 'subreddit%3A')
|
||||
. $name
|
||||
. '&sort='
|
||||
|
|
Loading…
Reference in a new issue