mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-13 12:04:09 +02:00
bridges: Replace returnError function with more specific
Replacements depend on original error code: 400: returnClientError 404: returnServerError 500: returnServerError 501: returnServerError
This commit is contained in:
@@ -6,7 +6,7 @@ class CommonDreamsBridge extends BridgeAbstract{
|
||||
$this->name = "CommonDreams Bridge";
|
||||
$this->uri = "http://www.commondreams.org/";
|
||||
$this->description = "Returns the newest articles.";
|
||||
$this->update = "2016-08-09";
|
||||
$this->update = '2016-08-17';
|
||||
}
|
||||
|
||||
private function CommonDreamsExtractContent($url) {
|
||||
@@ -25,7 +25,7 @@ class CommonDreamsBridge extends BridgeAbstract{
|
||||
return $string;
|
||||
}
|
||||
|
||||
$html = $this->file_get_html('http://www.commondreams.org/rss.xml') or $this->returnError('Could not request CommonDreams.', 404);
|
||||
$html = $this->file_get_html('http://www.commondreams.org/rss.xml') or $this->returnServerError('Could not request CommonDreams.');
|
||||
$limit = 0;
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 4) {
|
||||
|
Reference in New Issue
Block a user