1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-07 00:56:34 +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:
Pierre Mazière
2016-08-25 01:24:53 +02:00
parent dea37c8e34
commit 117031bf0f
131 changed files with 548 additions and 411 deletions

View File

@@ -15,7 +15,8 @@ class CNETBridge extends BridgeAbstract {
);
}
public function collectData(array $param) {
public function collectData(){
$param=$this->parameters[$this->queriedContext];
function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) {
@@ -42,8 +43,8 @@ class CNETBridge extends BridgeAbstract {
return $article_html;
}
if (!empty($param['topic']))
$this->topicName = $param['topic'];
if (!empty($param['topic']['value']))
$this->topicName = $param['topic']['value'];
$pageUrl = 'http://www.cnet.com/'.(empty($this->topicName) ? '' : 'topics/'.$this->topicName.'/');
$html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl);