mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-13 03:54:04 +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:
@@ -74,7 +74,7 @@ class GBAtempBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
private function fetch_post_content($uri, $site_url) {
|
||||
$html = $this->file_get_html($uri) or $this->returnServerError('Could not request GBAtemp: '.$uri);
|
||||
$html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('Could not request GBAtemp: '.$uri);
|
||||
$content = $html->find('div.messageContent', 0)->innertext;
|
||||
return $this->cleanup_post_content($content, $site_url);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ class GBAtempBridge extends BridgeAbstract {
|
||||
} else $this->returnClientError('The provided type filter is invalid. Expecting N, R, T, or F.');
|
||||
} else $this->returnClientError('Please provide a type filter. Expecting N, R, T, or F.');
|
||||
|
||||
$html = $this->file_get_html($this->uri) or $this->returnServerError('Could not request GBAtemp.');
|
||||
$html = $this->getSimpleHTMLDOM($this->uri) or $this->returnServerError('Could not request GBAtemp.');
|
||||
|
||||
if ($typeFilter == 'N') {
|
||||
foreach ($html->find('li[class=news_item full]') as $newsItem) {
|
||||
@@ -106,7 +106,7 @@ class GBAtempBridge extends BridgeAbstract {
|
||||
foreach ($html->find('li.portal_review') as $reviewItem) {
|
||||
$url = $this->uri.$reviewItem->find('a', 0)->href;
|
||||
$title = $reviewItem->find('span.review_title', 0)->plaintext;
|
||||
$content = $this->file_get_html($url) or $this->returnServerError('Could not request GBAtemp: '.$uri);
|
||||
$content = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request GBAtemp: '.$uri);
|
||||
$author = $content->find('a.username', 0)->plaintext;
|
||||
$time = intval($this->ExtractFromDelimiters($content->find('abbr.DateTime', 0)->outertext, 'data-time="', '"'));
|
||||
$intro = '<p><b>'.($content->find('div#review_intro', 0)->plaintext).'</b></p>';
|
||||
|
Reference in New Issue
Block a user