[ElsevierBridge] code simplification

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-28 14:15:38 +02:00
parent d4d635a7d2
commit 342de7744b

View file

@ -2,7 +2,7 @@
class ElsevierBridge extends BridgeAbstract{ class ElsevierBridge extends BridgeAbstract{
public $maintainer = 'Pierre Mazière'; public $maintainer = 'Pierre Mazière';
public $name = 'Elsevier journals recent articles'; public $name = 'Elsevier journals recent articles';
public $uri = 'http://www.journals.elsevier.com'; public $uri = 'http://www.journals.elsevier.com/';
public $description = 'Returns the recent articles published in Elsevier journals'; public $description = 'Returns the recent articles published in Elsevier journals';
public $parameters = array( array( public $parameters = array( array(
@ -56,7 +56,7 @@ class ElsevierBridge extends BridgeAbstract{
} }
public function collectData(){ public function collectData(){
$uri = 'http://www.journals.elsevier.com/' . $this->getInput('j') . '/recent-articles/'; $uri = $this->uri . $this->getInput('j') . '/recent-articles/';
$html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('No results for Elsevier journal '.$this->getInput('j')); $html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('No results for Elsevier journal '.$this->getInput('j'));
foreach($html->find('.pod-listing') as $article){ foreach($html->find('.pod-listing') as $article){