1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-21 23:55:56 +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:
logmanoriginal
2016-08-17 14:45:08 +02:00
parent 73a1bcf3d6
commit 74f0572d91
124 changed files with 401 additions and 400 deletions

View File

@@ -7,7 +7,7 @@ class BooruprojectBridge extends BridgeAbstract{
$this->name = "Booruproject";
$this->uri = "http://booru.org/";
$this->description = "Returns images from given page and booruproject instance (****.booru.org)";
$this->update = "2016-08-15";
$this->update = '2016-08-17';
$this->parameters[] =
'[
@@ -41,9 +41,9 @@ class BooruprojectBridge extends BridgeAbstract{
$tags = '&tags='.urlencode($param['t']);
}
if (empty($param['i'])) {
$this->returnError('Please enter a ***.booru.org instance.', 404);
$this->returnServerError('Please enter a ***.booru.org instance.');
}
$html = $this->file_get_html("http://".$param['i'].".booru.org/index.php?page=post&s=list&pid=".$page.$tags) or $this->returnError('Could not request Booruproject.', 404);
$html = $this->file_get_html("http://".$param['i'].".booru.org/index.php?page=post&s=list&pid=".$page.$tags) or $this->returnServerError('Could not request Booruproject.');
foreach($html->find('div[class=content] span') as $element) {