mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-11 02:54:10 +02:00
bridges: use BridgeAbstract::getSimpleHTMLDOM
instead of BridgeAbstract::file_get_html Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
@@ -10,21 +10,21 @@ class NiceMatinBridge extends BridgeAbstract{
|
||||
}
|
||||
|
||||
private function NiceMatinExtractContent($url) {
|
||||
$html = $this->file_get_html($url);
|
||||
$html = $this->getSimpleHTMLDOM($url);
|
||||
if(!$html)
|
||||
$this->returnServerError('Could not acquire content from url: ' . $url . '!');
|
||||
|
||||
|
||||
$content = $html->find('article', 0);
|
||||
if(!$content)
|
||||
$this->returnServerError('Could not find \'section\'!');
|
||||
|
||||
|
||||
$text = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content->innertext);
|
||||
$text = strip_tags($text, '<p><a><img>');
|
||||
return $text;
|
||||
}
|
||||
|
||||
public function collectData(array $param){
|
||||
$html = $this->file_get_html('http://www.nicematin.com/derniere-minute/rss') or $this->returnServerError('Could not request NiceMatin.');
|
||||
$html = $this->getSimpleHTMLDOM('http://www.nicematin.com/derniere-minute/rss') or $this->returnServerError('Could not request NiceMatin.');
|
||||
$limit = 0;
|
||||
|
||||
foreach($html->find('item') as $element) {
|
||||
|
Reference in New Issue
Block a user