Fix indentation and improve code style
- Use tab instead of spaces - Remove obsolete bridge description at start of the file - Add spaces at the assignment operator ('=' -> ' = ') - Remove unnecessary empty lines
This commit is contained in:
parent
f783969721
commit
a1c680f8e8
1 changed files with 78 additions and 86 deletions
|
@ -1,10 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* ElsevierBridge
|
||||
*
|
||||
* @name Elsevier Bridge
|
||||
* @description Returns the recent articles published in Elsevier journals
|
||||
*/
|
||||
class ElsevierBridge extends BridgeAbstract{
|
||||
public function loadMetadatas() {
|
||||
|
||||
|
@ -68,20 +62,17 @@ class ElsevierBridge extends BridgeAbstract{
|
|||
}
|
||||
|
||||
public function collectData(array $param){
|
||||
$uri = 'http://www.journals.elsevier.com/'.$param['j'].'/recent-articles/';
|
||||
$html = file_get_html($uri)
|
||||
or $this->returnError('No results for Elsevier journal '.$param['j'], 404);
|
||||
$uri = 'http://www.journals.elsevier.com/' . $param['j'] . '/recent-articles/';
|
||||
$html = file_get_html($uri) or $this->returnError('No results for Elsevier journal '.$param['j'], 404);
|
||||
|
||||
foreach($html->find('.pod-listing') as $article){
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri=$article->find('.pod-listing-header>a',0)->getAttribute('href').'?np=y';
|
||||
$item->title=$article->find('.pod-listing-header>a',0)->plaintext;
|
||||
$item->name=$this->ExtractArticleName($article);
|
||||
$item->timestamp=$this->ExtractArticleTimestamp($article);
|
||||
$item->content=$this->ExtractArticleContent($article);
|
||||
|
||||
$this->items[]=$item;
|
||||
$item->uri = $article->find('.pod-listing-header>a',0)->getAttribute('href').'?np=y';
|
||||
$item->title = $article->find('.pod-listing-header>a',0)->plaintext;
|
||||
$item->name = $this->ExtractArticleName($article);
|
||||
$item->timestamp = $this->ExtractArticleTimestamp($article);
|
||||
$item->content = $this->ExtractArticleContent($article);
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,3 +88,4 @@ class ElsevierBridge extends BridgeAbstract{
|
|||
return 43200; // 12h
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue