1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-31 13:50:23 +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 SiliconBridge extends BridgeAbstract {
$this->name = 'Silicon Bridge';
$this->uri = 'http://www.silicon.fr/';
$this->description = "Returns the newest articles.";
$this->update = "2016-08-09";
$this->update = '2016-08-17';
}
@@ -20,7 +20,7 @@ class SiliconBridge extends BridgeAbstract {
}
$feedUrl = 'http://www.silicon.fr/feed';
$html = $this->file_get_html($feedUrl) or $this->returnError('Could not request Silicon: '.$feedUrl, 500);
$html = $this->file_get_html($feedUrl) or $this->returnServerError('Could not request Silicon: '.$feedUrl);
$limit = 0;
foreach($html->find('item') as $element) {
@@ -30,7 +30,7 @@ class SiliconBridge extends BridgeAbstract {
$article_uri = $element->innertext;
$article_uri = substr($article_uri, strpos($article_uri, '<link>') + 6);
$article_uri = substr($article_uri, 0, strpos($article_uri, '</link>'));
$article_html = $this->file_get_html($article_uri) or $this->returnError('Could not request Silicon: '.$article_uri, 500);
$article_html = $this->file_get_html($article_uri) or $this->returnServerError('Could not request Silicon: '.$article_uri);
//Build article contents from corresponding elements
$thumbnailUri = $element->find('enclosure', 0)->url;