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:
Pierre Mazière 2016-07-08 19:06:35 +02:00
parent f43bbda83e
commit 3c0d13c1bb
121 changed files with 1212 additions and 396 deletions

View file

@ -51,7 +51,7 @@ class CNETBridge extends BridgeAbstract {
$this->topicName = $param['topic'];
$pageUrl = 'http://www.cnet.com/'.(empty($this->topicName) ? '' : 'topics/'.$this->topicName.'/');
$html = $this->file_get_html($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl);
$html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl);
$limit = 0;
foreach($html->find('div.assetBody') as $element) {
@ -64,7 +64,7 @@ class CNETBridge extends BridgeAbstract {
if (!empty($article_title) && !empty($article_uri) && strpos($article_uri, '/news/') !== false) {
$article_html = $this->file_get_html($article_uri) or $this->returnServerError('Could not request CNET: '.$article_uri);
$article_html = $this->getSimpleHTMLDOM($article_uri) or $this->returnServerError('Could not request CNET: '.$article_uri);
$article_content = trim(CleanArticle(ExtractFromDelimiters($article_html, '<div class="articleContent', '<footer>')));