mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-12 19:44:12 +02:00
[core + bridges] add BridgeAbstract::$inputs and BridgeAbstract::getInput()
Inputs are not stored in BridgeAbstract::$parameters anymore to separate static data from dynamic data. The getInput method allows for more readable code. Also fix an "undefined index 'global'" notice Probability of breaking bridges: high ! Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
@@ -17,14 +17,13 @@ class FlickrTagBridge extends BridgeAbstract{
|
||||
);
|
||||
|
||||
public function collectData(){
|
||||
$param=$this->parameters[$this->queriedContext];
|
||||
$html = $this->getSimpleHTMLDOM('http://www.flickr.com/search/?q=vendee&s=rec') or $this->returnServerError('Could not request Flickr.');
|
||||
if (isset($param['q']['value'])) { /* keyword search mode */
|
||||
$this->request = $param['q']['value'];
|
||||
if (isset($this->getInput('q'))) { /* keyword search mode */
|
||||
$this->request = $this->getInput('q');
|
||||
$html = $this->getSimpleHTMLDOM('http://www.flickr.com/search/?q='.urlencode($this->request).'&s=rec') or $this->returnServerError('No results for this query.');
|
||||
}
|
||||
elseif (isset($param['u']['value'])) { /* user timeline mode */
|
||||
$this->request = $param['u']['value'];
|
||||
elseif (isset($this->getInput('u'))) { /* user timeline mode */
|
||||
$this->request = $this->getInput('u');
|
||||
$html = $this->getSimpleHTMLDOM('http://www.flickr.com/photos/'.urlencode($this->request).'/') or $this->returnServerError('Requested username can\'t be found.');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user