[AcrimedBridge] reapply code simplification

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-09-04 14:58:25 +02:00
parent 3daeacc208
commit a0dfbe6efd

View file

@ -7,7 +7,7 @@ class AcrimedBridge extends FeedExpander {
const DESCRIPTION = "Returns the newest articles."; const DESCRIPTION = "Returns the newest articles.";
public function collectData(){ public function collectData(){
$this->collectExpandableDatas("http://www.acrimed.org/spip.php?page=backend"); $this->collectExpandableDatas(static::URI.'spip.php?page=backend');
} }
protected function parseItem($newsItem){ protected function parseItem($newsItem){
@ -16,7 +16,7 @@ class AcrimedBridge extends FeedExpander {
$hs = new HTMLSanitizer(); $hs = new HTMLSanitizer();
$articlePage = $this->getSimpleHTMLDOM($newsItem->link); $articlePage = $this->getSimpleHTMLDOM($newsItem->link);
$article = $hs->sanitize($articlePage->find('article.article1', 0)->innertext); $article = $hs->sanitize($articlePage->find('article.article1', 0)->innertext);
$article = HTMLSanitizer::defaultImageSrcTo($article, "http://www.acrimed.org/"); $article = HTMLSanitizer::defaultImageSrcTo($article, static::URI);
$item['content'] = $article; $item['content'] = $article;
return $item; return $item;