forked from blallo/rss-bridge
Added parameter check of OpenClassRooms.
This commit is contained in:
parent
7c5118959d
commit
a1152aee96
1 changed files with 6 additions and 1 deletions
|
@ -11,8 +11,13 @@
|
||||||
class OpenClassroomsBridge extends BridgeAbstract{
|
class OpenClassroomsBridge extends BridgeAbstract{
|
||||||
|
|
||||||
public function collectData(array $param){
|
public function collectData(array $param){
|
||||||
|
if ($param['u']!='informatique' && $param['u']!='sciences')
|
||||||
|
{
|
||||||
|
$this->returnError('Error: You must chose "informatique" or "science".', 404);
|
||||||
|
}
|
||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
$link = 'http://fr.openclassrooms.com/'.$param[u].'/cours?title=&sort=updatedAt+desc';
|
$link = 'http://fr.openclassrooms.com/'.$param['u'].'/cours?title=&sort=updatedAt+desc';
|
||||||
|
|
||||||
$html = file_get_html($link) or $this->returnError('Could not request OpenClassrooms.', 404);
|
$html = file_get_html($link) or $this->returnError('Could not request OpenClassrooms.', 404);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue