[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:
parent
15c422c648
commit
3bacb407fe
15 changed files with 20 additions and 20 deletions
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@ 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);
|
||||||
$item['content'] = $content->innertext;
|
$item['content'] = $content->innertext;
|
||||||
|
|
|
@ -84,9 +84,9 @@ 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']);
|
||||||
$item['content'] = $this->ExtractArticleContent($article);
|
$item['content'] = $this->ExtractArticleContent($article);
|
||||||
$item['author'] = empty($this->ExtractAuthor($article)) ? $item['author'] : $this->ExtractAuthor($article);
|
$item['author'] = empty($this->ExtractAuthor($article)) ? $item['author'] : $this->ExtractAuthor($article);
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@ 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);
|
||||||
$item['title'] = $article_html->find('h1.cleanprint-title', 0)->plaintext;
|
$item['title'] = $article_html->find('h1.cleanprint-title', 0)->plaintext;
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,14 +30,14 @@ 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'] = '';
|
||||||
|
|
||||||
$namespaces = $newsItem->getNamespaces(true);
|
$namespaces = $newsItem->getNamespaces(true);
|
||||||
if(isset($namespaces['media'])){
|
if(isset($namespaces['media'])){
|
||||||
$media = $newsItem->children($namespaces['media']);
|
$media = $newsItem->children($namespaces['media']);
|
||||||
if(isset($media->content)){
|
if(isset($media->content)){
|
||||||
$attributes = $media->content->attributes();
|
$attributes = $media->content->attributes();
|
||||||
$item['content'] = '<img src="' . $attributes['url'] . '">';
|
$item['content'] = '<img src="' . $attributes['url'] . '">';
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ class NextgovBridge extends FeedExpander {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function ExtractContent($url){
|
private function ExtractContent($url){
|
||||||
$article = $this->getSimpleHTMLDOMCached($url)
|
$article = $this->getSimpleHTMLDOMCached($url)
|
||||||
or $this->returnServerError('Could not request Nextgov: ' . $url);
|
or $this->returnServerError('Could not request Nextgov: ' . $url);
|
||||||
|
|
||||||
$contents = $article->find('div.wysiwyg', 0)->innertext;
|
$contents = $article->find('div.wysiwyg', 0)->innertext;
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue