mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-06 08:37:30 +02:00
Reformat codebase v4 (#2872)
Reformat code base to PSR12 Co-authored-by: rssbridge <noreply@github.com>
This commit is contained in:
@@ -1,38 +1,42 @@
|
||||
<?php
|
||||
class ViceBridge extends FeedExpander {
|
||||
const MAINTAINER = 'IceWreck';
|
||||
const NAME = 'Vice Bridge';
|
||||
const URI = 'https://www.vice.com/';
|
||||
const CACHE_TIMEOUT = 3600; // This is a news site, so don't cache for more than 10 mins
|
||||
const DESCRIPTION = 'RSS feed for vice publications like Vice News, Munchies, Motherboard, etc.';
|
||||
const PARAMETERS = array( array(
|
||||
'feed' => 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);
|
||||
}
|
||||
class ViceBridge extends FeedExpander
|
||||
{
|
||||
const MAINTAINER = 'IceWreck';
|
||||
const NAME = 'Vice Bridge';
|
||||
const URI = 'https://www.vice.com/';
|
||||
const CACHE_TIMEOUT = 3600; // This is a news site, so don't cache for more than 10 mins
|
||||
const DESCRIPTION = 'RSS feed for vice publications like Vice News, Munchies, Motherboard, etc.';
|
||||
const PARAMETERS = [ [
|
||||
'feed' => [
|
||||
'name' => 'Feed',
|
||||
'type' => 'list',
|
||||
'values' => [
|
||||
'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'
|
||||
]
|
||||
]
|
||||
]];
|
||||
|
||||
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;
|
||||
public function collectData()
|
||||
{
|
||||
$feed = $this->getInput('feed');
|
||||
$feedURL = 'https://www.vice.com/' . $feed;
|
||||
$this->collectExpandableDatas($feedURL, 10);
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user