[NineGagBridge] Add filter option for animated content (#1374)

This commit is contained in:
David 2019-12-01 13:07:25 +01:00 committed by LogMANOriginal
parent e518936be7
commit 375831f516

View file

@ -17,6 +17,15 @@ class NineGagBridge extends BridgeAbstract {
'Fresh' => 'fresh', 'Fresh' => 'fresh',
), ),
), ),
'video' => array(
'name' => 'Filter Video',
'type' => 'list',
'values' => array(
'NotFiltred' => 'none',
'VideoFiltred' => 'without',
'VideoOnly' => 'only',
),
),
'p' => array( 'p' => array(
'name' => 'Pages', 'name' => 'Pages',
'type' => 'number', 'type' => 'number',
@ -121,6 +130,24 @@ class NineGagBridge extends BridgeAbstract {
} }
foreach ($posts as $post) { 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['uri'] = $post['url'];
$item['title'] = $post['title']; $item['title'] = $post['title'];
$item['content'] = self::getContent($post); $item['content'] = self::getContent($post);
@ -130,6 +157,7 @@ class NineGagBridge extends BridgeAbstract {
$this->items[] = $item; $this->items[] = $item;
} }
} }
}
public function getName() { public function getName() {
if ($this->getInput('d')) { if ($this->getInput('d')) {