[GVBAtempBridge] fix getName() and fetch_post_content()
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
2ca854cacf
commit
05825cf6f7
1 changed files with 11 additions and 3 deletions
|
@ -54,14 +54,19 @@ class GBAtempBridge extends BridgeAbstract {
|
|||
}
|
||||
|
||||
private function fetch_post_content($uri, $site_url) {
|
||||
$html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('Could not request GBAtemp: '.$uri);
|
||||
$html = $this->getSimpleHTMLDOM($uri);
|
||||
if(!$html){
|
||||
return 'Could not request GBAtemp '.$uri;
|
||||
}
|
||||
|
||||
$content = $html->find('div.messageContent', 0)->innertext;
|
||||
return $this->cleanup_post_content($content, $site_url);
|
||||
}
|
||||
|
||||
public function collectData(){
|
||||
|
||||
$html = $this->getSimpleHTMLDOM($this->uri) or $this->returnServerError('Could not request GBAtemp.');
|
||||
$html = $this->getSimpleHTMLDOM($this->uri)
|
||||
or $this->returnServerError('Could not request GBAtemp.');
|
||||
|
||||
switch($this->getInput('type')){
|
||||
case 'N':
|
||||
|
@ -110,7 +115,10 @@ class GBAtempBridge extends BridgeAbstract {
|
|||
}
|
||||
|
||||
public function getName() {
|
||||
$type=array_search($this->getInput('type'),$param['type']['values']);
|
||||
$type=array_search(
|
||||
$this->getInput('type'),
|
||||
$this->parameters[$this->queriedContext]['type']['values']
|
||||
);
|
||||
return 'GBAtemp '.$type.' Bridge';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue