Add bridge for Phoronix (#1412)

This commit is contained in:
Anchit Bajaj 2020-02-27 02:40:54 +05:30 committed by GitHub
parent f0363ba03b
commit 96e58d4c94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,22 @@
<?php
class PhoronixBridge extends FeedExpander {
const MAINTAINER = 'IceWreck';
const NAME = 'Phoronix Bridge';
const URI = 'https://www.phoronix.com';
const CACHE_TIMEOUT = 3600;
const DESCRIPTION = 'RSS feed for Linux news website Phoronix';
public function collectData(){
$this->collectExpandableDatas('https://www.phoronix.com/rss.php', 15);
}
protected function parseItem($newsItem){
$item = parent::parseItem($newsItem);
// $articlePage gets the entire page's contents
$articlePage = getSimpleHTMLDOM($newsItem->link);
$article = $articlePage->find('.content', 0);
$item['content'] = $article;
return $item;
}
}