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
|
<?php
|
||||||
/**
|
|
||||||
* ElsevierBridge
|
|
||||||
*
|
|
||||||
* @name Elsevier Bridge
|
|
||||||
* @description Returns the recent articles published in Elsevier journals
|
|
||||||
*/
|
|
||||||
class ElsevierBridge extends BridgeAbstract{
|
class ElsevierBridge extends BridgeAbstract{
|
||||||
public function loadMetadatas() {
|
public function loadMetadatas() {
|
||||||
|
|
||||||
|
@ -69,18 +63,15 @@ class ElsevierBridge extends BridgeAbstract{
|
||||||
|
|
||||||
public function collectData(array $param){
|
public function collectData(array $param){
|
||||||
$uri = 'http://www.journals.elsevier.com/' . $param['j'] . '/recent-articles/';
|
$uri = 'http://www.journals.elsevier.com/' . $param['j'] . '/recent-articles/';
|
||||||
$html = file_get_html($uri)
|
$html = file_get_html($uri) or $this->returnError('No results for Elsevier journal '.$param['j'], 404);
|
||||||
or $this->returnError('No results for Elsevier journal '.$param['j'], 404);
|
|
||||||
|
|
||||||
foreach($html->find('.pod-listing') as $article){
|
foreach($html->find('.pod-listing') as $article){
|
||||||
|
|
||||||
$item = new \Item();
|
$item = new \Item();
|
||||||
$item->uri = $article->find('.pod-listing-header>a',0)->getAttribute('href').'?np=y';
|
$item->uri = $article->find('.pod-listing-header>a',0)->getAttribute('href').'?np=y';
|
||||||
$item->title = $article->find('.pod-listing-header>a',0)->plaintext;
|
$item->title = $article->find('.pod-listing-header>a',0)->plaintext;
|
||||||
$item->name = $this->ExtractArticleName($article);
|
$item->name = $this->ExtractArticleName($article);
|
||||||
$item->timestamp = $this->ExtractArticleTimestamp($article);
|
$item->timestamp = $this->ExtractArticleTimestamp($article);
|
||||||
$item->content = $this->ExtractArticleContent($article);
|
$item->content = $this->ExtractArticleContent($article);
|
||||||
|
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,3 +88,4 @@ class ElsevierBridge extends BridgeAbstract{
|
||||||
return 43200; // 12h
|
return 43200; // 12h
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
?>
|
Loading…
Reference in a new issue