mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[RedditBridge]: Add score filter (#2045)
This commit is contained in:
parent
00a24a98be
commit
13e9a96cf3
1 changed files with 13 additions and 0 deletions
|
@ -8,6 +8,15 @@ class RedditBridge extends BridgeAbstract {
|
|||
const DESCRIPTION = 'Return hot submissions from Reddit';
|
||||
|
||||
const PARAMETERS = array(
|
||||
'global' => array(
|
||||
'score' => array(
|
||||
'name' => 'Minimal score',
|
||||
'required' => false,
|
||||
'type' => 'number',
|
||||
'exampleValue' => 100,
|
||||
'title' => 'Filter out posts with lower score'
|
||||
)
|
||||
),
|
||||
'single' => array(
|
||||
'r' => array(
|
||||
'name' => 'SubReddit',
|
||||
|
@ -86,6 +95,10 @@ class RedditBridge extends BridgeAbstract {
|
|||
|
||||
$data = $post->data;
|
||||
|
||||
if ($data->score < $this->getInput('score')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = array();
|
||||
$item['author'] = $data->author;
|
||||
$item['uid'] = $data->id;
|
||||
|
|
Loading…
Add table
Reference in a new issue