[InstagramBridge] fix uri, remove useless code

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-27 14:57:43 +02:00
parent 760141a751
commit 614d425da4
1 changed files with 10 additions and 12 deletions

View File

@ -1,8 +1,6 @@
<?php <?php
class InstagramBridge extends BridgeAbstract{ class InstagramBridge extends BridgeAbstract{
private $request;
public function loadMetadatas() { public function loadMetadatas() {
$this->maintainer = "pauder"; $this->maintainer = "pauder";
@ -20,15 +18,8 @@ class InstagramBridge extends BridgeAbstract{
} }
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext]; $html = $this->getSimpleHTMLDOM($this->getURI())
$html = ''; or $this->returnServerError('Could not request Instagram.');
if (isset($param['u']['value'])) { /* user timeline mode */
$this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('http://instagram.com/'.urlencode($this->request)) or $this->returnServerError('Could not request Instagram.');
}
else {
$this->returnClientError('You must specify a Instagram username (?u=...).');
}
$innertext = null; $innertext = null;
@ -74,6 +65,13 @@ class InstagramBridge extends BridgeAbstract{
} }
public function getName(){ public function getName(){
return (!empty($this->request) ? $this->request .' - ' : '') .'Instagram Bridge'; $param=$this->parameters[$this->queriedContext];
return $this->param['u']['value'] .' - Instagram Bridge';
}
public function getURI(){
$param=$this->parameters[$this->queriedContext];
return $this->uri.urlencode($param['u']['value']);
} }
} }