From 4b0ac11b82ee48ebd1cbfea420b195a29dd0d611 Mon Sep 17 00:00:00 2001 From: Damien Calesse Date: Wed, 23 Jul 2014 12:53:02 +0200 Subject: [PATCH] Create ABCTabsBridge.php --- bridges/ABCTabsBridge.php | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 bridges/ABCTabsBridge.php diff --git a/bridges/ABCTabsBridge.php b/bridges/ABCTabsBridge.php new file mode 100644 index 0000000..f0973b6 --- /dev/null +++ b/bridges/ABCTabsBridge.php @@ -0,0 +1,44 @@ +returnError('No results for this query.', 404); + $table = $html->find('table#myTable', 0)->children(1); + + foreach ($table->find('tr') as $tab) + { + $item = new \Item(); + $item->name = $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'); + $this->items[] = $item; + } + } + public function getName(){ + return 'ABC Tabs Bridge'; + } + + public function getURI(){ + return 'http://www.abc-tabs.com/'; + } + + public function getCacheDuration(){ + return 3600; // 1 hour + } +}