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