diff --git a/bridges/ViceBridge.php b/bridges/ViceBridge.php new file mode 100644 index 00000000..4dccb8ef --- /dev/null +++ b/bridges/ViceBridge.php @@ -0,0 +1,38 @@ + array( + 'name' => 'Feed', + 'type' => 'list', + 'values' => array( + 'Vice News' => 'rss', + 'Motherboard - Tech' => 'en_us/rss/topic/tech', + 'Entertainment' => 'en_us/rss/topic/entertainment', + 'Noisey - Music' => 'en_us/rss/topic/music', + 'Munchies - Food' => 'en_us/rss/topic/food' + ) + ) + )); + + public function collectData(){ + $feed = $this->getInput('feed'); + $feedURL = 'https://www.vice.com/' . $feed; + $this->collectExpandableDatas($feedURL, 10); + } + + protected function parseItem($newsItem){ + $item = parent::parseItem($newsItem); + // $articlePage gets the entire page's contents + $articlePage = getSimpleHTMLDOM($newsItem->link); + // text and embedded content + $article = $article . $articlePage->find('.article__body', 0); + $item['content'] = $article; + + return $item; + } +}