1
0
Fork 0
forked from blallo/rss-bridge

[GizmodoFRBridge] code simplification

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-29 00:22:54 +02:00
parent 9f6aff9699
commit 88f5014a16

View file

@ -10,6 +10,9 @@ class GizmodoFRBridge extends BridgeAbstract{
function GizmodoFRExtractContent($url) {
$articleHTMLContent = $this->getSimpleHTMLDOM($url);
if(!$articleHTMLContent){
return 'Could not load '.$url;
}
$text = $articleHTMLContent->find('div.entry-thumbnail', 0)->innertext;
$text = $text.$articleHTMLContent->find('div.entry-excerpt', 0)->innertext;
$text = $text.$articleHTMLContent->find('div.entry-content', 0)->innertext;
@ -21,7 +24,8 @@ class GizmodoFRBridge extends BridgeAbstract{
return $text;
}
$rssFeed = $this->getSimpleHTMLDOM('http://www.gizmodo.fr/feed') or $this->returnServerError('Could not request http://www.gizmodo.fr/feed');
$rssFeed = $this->getSimpleHTMLDOM($this->uri.'/feed')
or $this->returnServerError('Could not request '.$this->uri.'/feed');
$limit = 0;
foreach($rssFeed->find('item') as $element) {