2014-05-26 02:30:46 +04:00
|
|
|
<?php
|
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
class CopieDoubleBridge extends BridgeAbstract
|
|
|
|
{
|
|
|
|
const MAINTAINER = 'superbaillot.net';
|
|
|
|
const NAME = 'CopieDouble';
|
|
|
|
const URI = 'http://www.copie-double.com/';
|
|
|
|
const CACHE_TIMEOUT = 14400; // 4h
|
|
|
|
const DESCRIPTION = 'CopieDouble';
|
2015-11-04 01:28:44 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
public function collectData()
|
|
|
|
{
|
|
|
|
$html = getSimpleHTMLDOM(self::URI);
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
$table = $html->find('table table', 2);
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
foreach ($table->find('tr') as $element) {
|
|
|
|
$td = $element->find('td', 0);
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
if ($td->class === 'couleur_1') {
|
|
|
|
$item = [];
|
|
|
|
$title = $td->innertext;
|
|
|
|
$pos = strpos($title, '<a');
|
|
|
|
$title = substr($title, 0, $pos);
|
|
|
|
$item['title'] = $title;
|
|
|
|
} elseif (strpos($element->innertext, '/images/suivant.gif') === false) {
|
|
|
|
$a = $element->find('a', 0);
|
|
|
|
$item['uri'] = self::URI . $a->href;
|
|
|
|
$content = str_replace('src="/', 'src="/' . self::URI, $element->find('td', 0)->innertext);
|
|
|
|
$content = str_replace('href="/', 'href="' . self::URI, $content);
|
|
|
|
$item['content'] = $content;
|
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-05-26 02:30:46 +04:00
|
|
|
}
|