2014-05-26 02:30:46 +04:00
|
|
|
<?php
|
|
|
|
class CopieDoubleBridge extends BridgeAbstract{
|
|
|
|
|
2015-11-04 01:28:44 +03:00
|
|
|
public function loadMetadatas() {
|
|
|
|
|
|
|
|
$this->maintainer = "superbaillot.net";
|
|
|
|
$this->name = "CopieDouble";
|
|
|
|
$this->uri = "http://www.copie-double.com/";
|
|
|
|
$this->description = "CopieDouble";
|
2016-08-06 17:00:56 +03:00
|
|
|
$this->update = "2016-08-06";
|
2015-11-04 01:28:44 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-26 02:30:46 +04:00
|
|
|
public function collectData(array $param){
|
2016-06-26 00:17:42 +03:00
|
|
|
$html = $this->file_get_html('http://www.copie-double.com/') or $this->returnError('Could not request CopieDouble.', 404);
|
2014-05-26 02:30:46 +04:00
|
|
|
$table = $html->find('table table', 2);
|
|
|
|
|
|
|
|
foreach($table->find('tr') as $element)
|
|
|
|
{
|
|
|
|
$td = $element->find('td', 0);
|
|
|
|
$cpt++;
|
|
|
|
if($td->class == "couleur_1")
|
|
|
|
{
|
|
|
|
$item = new 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 = "http://www.copie-double.com" . $a->href;
|
|
|
|
|
|
|
|
$content = str_replace('src="/', 'src="http://www.copie-double.com/',$element->find("td", 0)->innertext);
|
|
|
|
$content = str_replace('href="/', 'href="http://www.copie-double.com/',$content);
|
|
|
|
$item->content = $content;
|
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName(){
|
|
|
|
return 'CopieDouble';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getURI(){
|
|
|
|
return 'http://www.copie-double.com';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCacheDuration(){
|
|
|
|
return 14400; // 4 hours
|
|
|
|
}
|
|
|
|
}
|