1
0
Fork 0
forked from blallo/rss-bridge

[bridges] use parent::parseItems() instead of feed type specific method

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-09-12 10:42:27 +02:00
parent 15c422c648
commit 3bacb407fe
15 changed files with 20 additions and 20 deletions

View file

@ -11,7 +11,7 @@ class AcrimedBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$hs = new HTMLSanitizer(); $hs = new HTMLSanitizer();
$articlePage = $this->getSimpleHTMLDOM($newsItem->link); $articlePage = $this->getSimpleHTMLDOM($newsItem->link);

View file

@ -10,7 +10,7 @@ class CADBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = $this->CADExtractContent($item['uri']); $item['content'] = $this->CADExtractContent($item['uri']);
return $item; return $item;
} }

View file

@ -11,7 +11,7 @@ class CommonDreamsBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = $this->CommonDreamsExtractContent($item['uri']); $item['content'] = $this->CommonDreamsExtractContent($item['uri']);
return $item; return $item;
} }

View file

@ -41,7 +41,7 @@ class DauphineLibereBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = $this->ExtractContent($item['uri']); $item['content'] = $this->ExtractContent($item['uri']);
return $item; return $item;
} }

View file

@ -11,7 +11,7 @@ class DeveloppezDotComBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = $this->DeveloppezDotComExtractContent($item['uri']); $item['content'] = $this->DeveloppezDotComExtractContent($item['uri']);
return $item; return $item;
} }

View file

@ -11,7 +11,7 @@ class FreenewsBridge extends FeedExpander {
} }
protected function parseItem($newsItem) { protected function parseItem($newsItem) {
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$articlePage = $this->getSimpleHTMLDOMCached($item['uri']); $articlePage = $this->getSimpleHTMLDOMCached($item['uri']);
$content = $articlePage->find('.post-container', 0); $content = $articlePage->find('.post-container', 0);

View file

@ -84,7 +84,7 @@ class FuturaSciencesBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['uri'] = str_replace('#xtor=RSS-8', '', $item['uri']); $item['uri'] = str_replace('#xtor=RSS-8', '', $item['uri']);
$article = $this->getSimpleHTMLDOMCached($item['uri']) $article = $this->getSimpleHTMLDOMCached($item['uri'])
or $this->returnServerError('Could not request Futura-Sciences: ' . $item['uri']); or $this->returnServerError('Could not request Futura-Sciences: ' . $item['uri']);

View file

@ -11,7 +11,7 @@ class LeJournalDuGeekBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = $this->LeJournalDuGeekExtractContent($item['uri']); $item['content'] = $this->LeJournalDuGeekExtractContent($item['uri']);
return $item; return $item;
} }

View file

@ -11,7 +11,7 @@ class LeMondeInformatiqueBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_1_0_Item($newsItem); $item = parent::parseItem($newsItem);
$article_html = $this->getSimpleHTMLDOMCached($item['uri']) $article_html = $this->getSimpleHTMLDOMCached($item['uri'])
or $this->returnServerError('Could not request LeMondeInformatique: ' . $item['uri']); or $this->returnServerError('Could not request LeMondeInformatique: ' . $item['uri']);
$item['content'] = $this->CleanArticle($article_html->find('div#article', 0)->innertext); $item['content'] = $this->CleanArticle($article_html->find('div#article', 0)->innertext);

View file

@ -11,7 +11,7 @@ class LichessBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseATOMItem($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = $this->retrieve_lichess_post($item['uri']); $item['content'] = $this->retrieve_lichess_post($item['uri']);
return $item; return $item;
} }

View file

@ -11,7 +11,7 @@ class NextInpactBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = $this->ExtractContent($item['uri']); $item['content'] = $this->ExtractContent($item['uri']);
return $item; return $item;
} }

View file

@ -30,7 +30,7 @@ class NextgovBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = ''; $item['content'] = '';

View file

@ -11,7 +11,7 @@ class NiceMatinBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = $this->NiceMatinExtractContent($item['uri']); $item['content'] = $this->NiceMatinExtractContent($item['uri']);
return $item; return $item;
} }

View file

@ -11,7 +11,7 @@ class NumeramaBridge extends FeedExpander {
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem); $item = parent::parseItem($newsItem);
$item['content'] = $this->ExtractContent($item['uri']); $item['content'] = $this->ExtractContent($item['uri']);
return $item; return $item;
} }

View file

@ -11,7 +11,7 @@ class TheOatmealBridge extends FeedExpander{
} }
protected function parseItem($newsItem) { protected function parseItem($newsItem) {
$item = $this->parseRSS_1_0_Item($newsItem); $item = parent::parseItem($newsItem);
$articlePage = $this->getSimpleHTMLDOMCached($item['uri']); $articlePage = $this->getSimpleHTMLDOMCached($item['uri']);
$content = $articlePage->find('#comic', 0); $content = $articlePage->find('#comic', 0);