mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-30 21:30:14 +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:
@@ -22,27 +22,28 @@ class PinterestBridge extends BridgeAbstract{
|
||||
);
|
||||
}
|
||||
|
||||
public function collectData(array $param){
|
||||
public function collectData(){
|
||||
$param=$this->parameters[$this->queriedContext];
|
||||
$html = '';
|
||||
if (isset($param['u']) || isset($param['b'])) {
|
||||
if (isset($param['u']['value']) || isset($param['b']['value'])) {
|
||||
|
||||
if (empty($param['u']))
|
||||
if (empty($param['u']['value']))
|
||||
{
|
||||
$this->returnClientError('You must specify a Pinterest username (?u=...).');
|
||||
}
|
||||
|
||||
if (empty($param['b']))
|
||||
if (empty($param['b']['value']))
|
||||
{
|
||||
$this->returnClientError('You must specify a Pinterest board for this username (?b=...).');
|
||||
}
|
||||
|
||||
$this->username = $param['u'];
|
||||
$this->board = $param['b'];
|
||||
$this->username = $param['u']['value'];
|
||||
$this->board = $param['b']['value'];
|
||||
$html = $this->getSimpleHTMLDOM($this->getURI().'/'.urlencode($this->username).'/'.urlencode($this->board)) or $this->returnServerError('Username and/or board not found');
|
||||
|
||||
} else if (isset($param['q']))
|
||||
} else if (isset($param['q']['value']))
|
||||
{
|
||||
$this->query = $param['q'];
|
||||
$this->query = $param['q']['value'];
|
||||
$html = $this->getSimpleHTMLDOM($this->getURI().'/search/?q='.urlencode($this->query)) or $this->returnServerError('Could not request Pinterest.');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user