From e5a375ab485d01d81c52fad547dad16aea7b1e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Thu, 1 Sep 2016 23:47:26 +0200 Subject: [PATCH] [ABCTabsBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/ABCTabsBridge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bridges/ABCTabsBridge.php b/bridges/ABCTabsBridge.php index 741d92c..247ab00 100644 --- a/bridges/ABCTabsBridge.php +++ b/bridges/ABCTabsBridge.php @@ -8,7 +8,7 @@ class ABCTabsBridge extends BridgeAbstract{ public function collectData(){ $html = ''; - $html = $this->getSimpleHTMLDOM('http://www.abc-tabs.com/tablatures/nouveautes.html') or $this->returnClientError('No results for this query.'); + $html = $this->getSimpleHTMLDOM(static::URI.'tablatures/nouveautes.html') or $this->returnClientError('No results for this query.'); $table = $html->find('table#myTable', 0)->children(1); foreach ($table->find('tr') as $tab) @@ -17,8 +17,8 @@ class ABCTabsBridge extends BridgeAbstract{ $item['author'] = $tab->find('td', 1)->plaintext . ' - ' . $tab->find('td', 2)->plaintext; $item['title'] = $tab->find('td', 1)->plaintext . ' - ' . $tab->find('td', 2)->plaintext; $item['content'] = 'Le ' . $tab->find('td', 0)->plaintext . '
Par: ' . $tab->find('td', 5)->plaintext . '
Type: ' . $tab->find('td', 3)->plaintext; - $item['id'] = 'http://www.abc-tabs.com' . $tab->find('td', 2)->find('a', 0)->getAttribute('href'); - $item['uri'] = 'http://www.abc-tabs.com' . $tab->find('td', 2)->find('a', 0)->getAttribute('href'); + $item['id'] = static::URI . $tab->find('td', 2)->find('a', 0)->getAttribute('href'); + $item['uri'] = static::URI . $tab->find('td', 2)->find('a', 0)->getAttribute('href'); $this->items[] = $item; } }