mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-16 21:44:01 +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:
@@ -24,10 +24,9 @@ class GoogleSearchBridge extends BridgeAbstract{
|
||||
|
||||
|
||||
public function collectData(){
|
||||
$param=$this->parameters[$this->queriedContext];
|
||||
$html = '';
|
||||
|
||||
$html = $this->getSimpleHTMLDOM('https://www.google.com/search?q=' . urlencode($param['q']['value']) . '&num=100&complete=0&tbs=qdr:y,sbd:1') or $this->returnServerError('No results for this query.');
|
||||
$html = $this->getSimpleHTMLDOM('https://www.google.com/search?q=' . urlencode($this->getInput('q')) . '&num=100&complete=0&tbs=qdr:y,sbd:1') or $this->returnServerError('No results for this query.');
|
||||
|
||||
$emIsRes = $html->find('div[id=ires]',0);
|
||||
if( !is_null($emIsRes) ){
|
||||
@@ -47,8 +46,7 @@ class GoogleSearchBridge extends BridgeAbstract{
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
$param=$this->parameters[$this->queriedContext];
|
||||
return $param['q']['value'] .' - Google search';
|
||||
return $this->getInput('q') .' - Google search';
|
||||
}
|
||||
|
||||
public function getCacheDuration(){
|
||||
|
Reference in New Issue
Block a user