Browse Source

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

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
Pierre Mazière 7 years ago
parent
commit
3bacb407fe

+ 1 - 1
bridges/AcrimedBridge.php

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

+ 1 - 1
bridges/CADBridge.php

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

+ 1 - 1
bridges/CommonDreamsBridge.php

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

+ 1 - 1
bridges/DauphineLibereBridge.php

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

+ 1 - 1
bridges/DeveloppezDotComBridge.php

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

+ 2 - 2
bridges/FreenewsBridge.php

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

+ 2 - 2
bridges/FuturaSciencesBridge.php

@@ -84,9 +84,9 @@ class FuturaSciencesBridge extends FeedExpander {
     }
 
     protected function parseItem($newsItem){
-        $item = $this->parseRSS_2_0_Item($newsItem);
+        $item = parent::parseItem($newsItem);
         $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']);
         $item['content'] = $this->ExtractArticleContent($article);
         $item['author'] = empty($this->ExtractAuthor($article)) ? $item['author'] : $this->ExtractAuthor($article);

+ 1 - 1
bridges/LeJournalDuGeekBridge.php

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

+ 2 - 2
bridges/LeMondeInformatiqueBridge.php

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

+ 1 - 1
bridges/LichessBridge.php

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

+ 1 - 1
bridges/NextInpactBridge.php

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

+ 3 - 3
bridges/NextgovBridge.php

@@ -30,14 +30,14 @@ class NextgovBridge extends FeedExpander {
     }
 
     protected function parseItem($newsItem){
-        $item = $this->parseRSS_2_0_Item($newsItem);
+        $item = parent::parseItem($newsItem);
 
         $item['content'] = '';
 
         $namespaces = $newsItem->getNamespaces(true);
         if(isset($namespaces['media'])){
             $media = $newsItem->children($namespaces['media']);
-            if(isset($media->content)){ 
+            if(isset($media->content)){
                 $attributes = $media->content->attributes();
                 $item['content'] = '<img src="' . $attributes['url'] . '">';
             }
@@ -56,7 +56,7 @@ class NextgovBridge extends FeedExpander {
     }
 
     private function ExtractContent($url){
-        $article = $this->getSimpleHTMLDOMCached($url) 
+        $article = $this->getSimpleHTMLDOMCached($url)
             or $this->returnServerError('Could not request Nextgov: ' . $url);
 
         $contents = $article->find('div.wysiwyg', 0)->innertext;

+ 1 - 1
bridges/NiceMatinBridge.php

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

+ 1 - 1
bridges/NumeramaBridge.php

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

+ 1 - 1
bridges/TheOatMealBridge.php

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