mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-22 08:03:52 +02:00
[core] store parameters values in BridgeAbstract::parameters
This way, any BridgeAbstract method can now have access to these values, no only collectData Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
@@ -45,21 +45,22 @@ class DailymotionBridge extends BridgeAbstract{
|
||||
return $metadata;
|
||||
}
|
||||
|
||||
public function collectData(array $param){
|
||||
public function collectData(){
|
||||
$param=$this->parameters[$this->queriedContext];
|
||||
$html = '';
|
||||
$limit = 5;
|
||||
$count = 0;
|
||||
|
||||
if (isset($param['u'])) { // user timeline mode
|
||||
$this->request = $param['u'];
|
||||
if (isset($param['u']['value'])) { // user timeline mode
|
||||
$this->request = $param['u']['value'];
|
||||
$html = $this->getSimpleHTMLDOM('http://www.dailymotion.com/user/'.urlencode($this->request).'/1') or $this->returnServerError('Could not request Dailymotion.');
|
||||
}
|
||||
else if (isset($param['p'])) { // playlist mode
|
||||
$this->request = strtok($param['p'], '_');
|
||||
else if (isset($param['p']['value'])) { // playlist mode
|
||||
$this->request = strtok($param['p']['value'], '_');
|
||||
$html = $this->getSimpleHTMLDOM('http://www.dailymotion.com/playlist/'.urlencode($this->request).'') or $this->returnServerError('Could not request Dailymotion.');
|
||||
}
|
||||
else if (isset($param['s'])) { // search mode
|
||||
$this->request = $param['s']; $page = 1; if (isset($param['pa'])) $page = (int)preg_replace("/[^0-9]/",'', $param['pa']);
|
||||
else if (isset($param['s']['value'])) { // search mode
|
||||
$this->request = $param['s']['value']; $page = 1; if (isset($param['pa']['value'])) $page = (int)preg_replace("/[^0-9]/",'', $param['pa']['value']);
|
||||
$html = $this->getSimpleHTMLDOM('http://www.dailymotion.com/search/'.urlencode($this->request).'/'.$page.'') or $this->returnServerError('Could not request Dailymotion.');
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user