[NineGagBridge] Add filter option for animated content (#1374)
This commit is contained in:
parent
e518936be7
commit
375831f516
1 changed files with 34 additions and 6 deletions
|
@ -17,6 +17,15 @@ class NineGagBridge extends BridgeAbstract {
|
|||
'Fresh' => 'fresh',
|
||||
),
|
||||
),
|
||||
'video' => array(
|
||||
'name' => 'Filter Video',
|
||||
'type' => 'list',
|
||||
'values' => array(
|
||||
'NotFiltred' => 'none',
|
||||
'VideoFiltred' => 'without',
|
||||
'VideoOnly' => 'only',
|
||||
),
|
||||
),
|
||||
'p' => array(
|
||||
'name' => 'Pages',
|
||||
'type' => 'number',
|
||||
|
@ -121,6 +130,24 @@ class NineGagBridge extends BridgeAbstract {
|
|||
}
|
||||
|
||||
foreach ($posts as $post) {
|
||||
$AvoidElement = false;
|
||||
switch ($this->getInput('video')) {
|
||||
case 'without':
|
||||
if ($post['type'] === 'Animated') {
|
||||
$AvoidElement = true;
|
||||
}
|
||||
break;
|
||||
case 'only':
|
||||
echo $post['type'];
|
||||
if ($post['type'] !== 'Animated') {
|
||||
$AvoidElement = true;
|
||||
}
|
||||
break;
|
||||
case 'none': default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$AvoidElement) {
|
||||
$item['uri'] = $post['url'];
|
||||
$item['title'] = $post['title'];
|
||||
$item['content'] = self::getContent($post);
|
||||
|
@ -130,6 +157,7 @@ class NineGagBridge extends BridgeAbstract {
|
|||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
if ($this->getInput('d')) {
|
||||
|
|
Loading…
Reference in a new issue