2014-07-23 13:11:55 +02:00
|
|
|
<?php
|
|
|
|
class ABCTabsBridge extends BridgeAbstract{
|
2015-11-03 23:28:44 +01:00
|
|
|
|
2016-08-30 11:23:55 +02:00
|
|
|
const MAINTAINER = "kranack";
|
|
|
|
const NAME = "ABC Tabs Bridge";
|
|
|
|
const URI = "http://www.abc-tabs.com/";
|
|
|
|
const DESCRIPTION = "Returns 22 newest tabs";
|
2015-11-03 23:28:44 +01:00
|
|
|
|
2016-08-25 01:24:53 +02:00
|
|
|
public function collectData(){
|
2014-07-23 13:11:55 +02:00
|
|
|
$html = '';
|
2016-09-25 23:22:33 +02:00
|
|
|
$html = getSimpleHTMLDOM(static::URI.'tablatures/nouveautes.html') or returnClientError('No results for this query.');
|
2014-07-23 13:11:55 +02:00
|
|
|
$table = $html->find('table#myTable', 0)->children(1);
|
2016-07-08 19:06:35 +02:00
|
|
|
|
2014-07-23 13:11:55 +02:00
|
|
|
foreach ($table->find('tr') as $tab)
|
|
|
|
{
|
2016-08-22 18:55:59 +02:00
|
|
|
$item = array();
|
|
|
|
$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 . '<br> Par: ' . $tab->find('td', 5)->plaintext . '<br> Type: ' . $tab->find('td', 3)->plaintext;
|
2016-09-01 23:47:26 +02:00
|
|
|
$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');
|
2014-07-23 13:11:55 +02:00
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|