mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-08 16:08:54 +00:00
[GizmodoFRBridge] code simplification
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
9f6aff9699
commit
88f5014a16
@ -10,6 +10,9 @@ class GizmodoFRBridge extends BridgeAbstract{
|
|||||||
|
|
||||||
function GizmodoFRExtractContent($url) {
|
function GizmodoFRExtractContent($url) {
|
||||||
$articleHTMLContent = $this->getSimpleHTMLDOM($url);
|
$articleHTMLContent = $this->getSimpleHTMLDOM($url);
|
||||||
|
if(!$articleHTMLContent){
|
||||||
|
return 'Could not load '.$url;
|
||||||
|
}
|
||||||
$text = $articleHTMLContent->find('div.entry-thumbnail', 0)->innertext;
|
$text = $articleHTMLContent->find('div.entry-thumbnail', 0)->innertext;
|
||||||
$text = $text.$articleHTMLContent->find('div.entry-excerpt', 0)->innertext;
|
$text = $text.$articleHTMLContent->find('div.entry-excerpt', 0)->innertext;
|
||||||
$text = $text.$articleHTMLContent->find('div.entry-content', 0)->innertext;
|
$text = $text.$articleHTMLContent->find('div.entry-content', 0)->innertext;
|
||||||
@ -21,7 +24,8 @@ class GizmodoFRBridge extends BridgeAbstract{
|
|||||||
return $text;
|
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;
|
$limit = 0;
|
||||||
|
|
||||||
foreach($rssFeed->find('item') as $element) {
|
foreach($rssFeed->find('item') as $element) {
|
||||||
|
Loading…
Reference in New Issue
Block a user