1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-27 10:04:53 +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

@@ -6,7 +6,7 @@ class CollegeDeFranceBridge extends BridgeAbstract{
$this->name = "CollegeDeFrance";
$this->uri = "http://www.college-de-france.fr/";
$this->description = "Returns the latest audio and video from CollegeDeFrance";
$this->update = "2016-08-09";
$this->update = '2016-08-17';
}
public function collectData(array $param) {
@@ -33,7 +33,7 @@ class CollegeDeFranceBridge extends BridgeAbstract{
* </a>
* </li>
*/
$html = $this->file_get_html('http://www.college-de-france.fr/components/search-audiovideo.jsp?fulltext=&siteid=1156951719600&lang=FR&type=all') or $this->returnError('Could not request CollegeDeFrance.', 404);
$html = $this->file_get_html('http://www.college-de-france.fr/components/search-audiovideo.jsp?fulltext=&siteid=1156951719600&lang=FR&type=all') or $this->returnServerError('Could not request CollegeDeFrance.');
foreach($html->find('a[data-target]') as $element) {
$item = new \Item();
$item->title = $element->find('.title', 0)->plaintext;