diff --git a/bridges/LeJournalDuGeekBridge.php b/bridges/LeJournalDuGeekBridge.php index 04de7a44..69f940ac 100644 --- a/bridges/LeJournalDuGeekBridge.php +++ b/bridges/LeJournalDuGeekBridge.php @@ -2,68 +2,67 @@ class LeJournalDuGeekBridge extends BridgeAbstract{ public function loadMetadatas() { - $this->maintainer = "polopollo"; $this->name = "journaldugeek.com (FR)"; $this->uri = "http://www.journaldugeek.com/"; $this->description = "Returns the 5 newest posts from LeJournalDuGeek (full text)."; - $this->update = "2014-07-14"; - + $this->update = "2016-08-03"; } - public function collectData(array $param){ + function LeJournalDuGeekStripCDATA($string) { + $string = str_replace('', '', $string); + return $string; + } - function LeJournalDuGeekStripCDATA($string) { - $string = str_replace('', '', $string); - return $string; - } + function LeJournalDuGeekExtractContent($url) { + $articleHTMLContent = $this->file_get_html($url); + $text = $articleHTMLContent->find('div.post-content', 0)->innertext; - function LeJournalDuGeekExtractContent($url) { - $articleHTMLContent = $this->file_get_html($url); - $text = $text.$articleHTMLContent->find('div.post-content', 0)->innertext; - foreach($articleHTMLContent->find('a.more') as $element) { - if ($element->innertext == "Source") { - $text = $text.'

Source : '.$element->href.'

'; - break; - } - } - foreach($articleHTMLContent->find('iframe') as $element) { - if (preg_match("/youtube/i", $element->src)) { - $text = $text.'// An IFRAME to Youtube was included in the article: '.$element->src.'
'; - } - } + foreach($articleHTMLContent->find('a.more') as $element) { + if ($element->innertext == "Source") { + $text = $text . '

Source : ' . $element->href . '

'; + break; + } + } - $text = strip_tags($text, '