2014-07-23 15:11:55 +04:00
|
|
|
<?php
|
|
|
|
class ABCTabsBridge extends BridgeAbstract{
|
2015-11-04 01:28:44 +03:00
|
|
|
|
2016-08-27 22:03:26 +03:00
|
|
|
public $maintainer = "kranack";
|
|
|
|
public $name = "ABC Tabs Bridge";
|
|
|
|
public $uri = "http://www.abc-tabs.com/";
|
|
|
|
public $description = "Returns 22 newest tabs";
|
2015-11-04 01:28:44 +03:00
|
|
|
|
2016-08-25 02:24:53 +03:00
|
|
|
public function collectData(){
|
2014-07-23 15:11:55 +04:00
|
|
|
$html = '';
|
2016-07-08 20:06:35 +03:00
|
|
|
$html = $this->getSimpleHTMLDOM('http://www.abc-tabs.com/tablatures/nouveautes.html') or $this->returnClientError('No results for this query.');
|
2014-07-23 15:11:55 +04:00
|
|
|
$table = $html->find('table#myTable', 0)->children(1);
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2014-07-23 15:11:55 +04:00
|
|
|
foreach ($table->find('tr') as $tab)
|
|
|
|
{
|
2016-08-22 19:55:59 +03: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;
|
|
|
|
$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');
|
2014-07-23 15:11:55 +04:00
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|