bridges: rename file_get_html to getSimpleHTMLDOM

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-09 14:57:42 +02:00
parent 86515a1560
commit 6e2c7ceaf4
12 changed files with 38 additions and 38 deletions

View file

@ -20,7 +20,7 @@ class NumeramaBridge extends BridgeAbstract{
}
$feed = $this->uri.'feed/';
$html = $this->file_get_html($feed) or $this->returnServerError('Could not request Numerama: '.$feed);
$html = $this->getSimpleHTMLDOM($feed) or $this->returnServerError('Could not request Numerama: '.$feed);
$limit = 0;
foreach($html->find('item') as $element) {
@ -32,7 +32,7 @@ class NumeramaBridge extends BridgeAbstract{
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
$article_url = NumeramaStripCDATA($element->find('guid', 0)->plaintext);
$article_html = $this->file_get_html($article_url) or $this->returnServerError('Could not request Numerama: '.$article_url);
$article_html = $this->getSimpleHTMLDOM($article_url) or $this->returnServerError('Could not request Numerama: '.$article_url);
$contents = $article_html->find('section[class=related-article]', 0)->innertext = ''; // remove related articles block
$contents = '<img alt="" style="max-width:300px;" src="'.$article_html->find('meta[property=og:image]', 0)->getAttribute('content').'">'; // add post picture
$contents = $contents.$article_html->find('article[class=post-content]', 0)->innertext; // extract the post