From a88ad96ad98bb5515062f96e03d957e7fec3f351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:59:26 +0200 Subject: [PATCH] [SiliconBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/SiliconBridge.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridges/SiliconBridge.php b/bridges/SiliconBridge.php index f821bcf..fffccaa 100644 --- a/bridges/SiliconBridge.php +++ b/bridges/SiliconBridge.php @@ -14,8 +14,9 @@ class SiliconBridge extends BridgeAbstract { return $string; } - $feedUrl = 'http://www.silicon.fr/feed'; - $html = $this->getSimpleHTMLDOM($feedUrl) or $this->returnServerError('Could not request Silicon: '.$feedUrl); + $feedUrl = $this->uri.'feed'; + $html = $this->getSimpleHTMLDOM($feedUrl) + or $this->returnServerError('Could not request Silicon: '.$feedUrl); $limit = 0; foreach($html->find('item') as $element) { @@ -25,7 +26,8 @@ class SiliconBridge extends BridgeAbstract { $article_uri = $element->innertext; $article_uri = substr($article_uri, strpos($article_uri, '') + 6); $article_uri = substr($article_uri, 0, strpos($article_uri, '')); - $article_html = $this->getSimpleHTMLDOM($article_uri) or $this->returnServerError('Could not request Silicon: '.$article_uri); + $article_html = $this->getSimpleHTMLDOM($article_uri) + or $this->returnServerError('Could not request Silicon: '.$article_uri); //Build article contents from corresponding elements $thumbnailUri = $element->find('enclosure', 0)->url;