mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-24 02:16:08 +03:00
3c0d13c1bb
instead of BridgeAbstract::file_get_html Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
48 lines
1.5 KiB
PHP
48 lines
1.5 KiB
PHP
<?php
|
|
class CopieDoubleBridge extends BridgeAbstract{
|
|
|
|
public function loadMetadatas() {
|
|
|
|
$this->maintainer = "superbaillot.net";
|
|
$this->name = "CopieDouble";
|
|
$this->uri = "http://www.copie-double.com/";
|
|
$this->description = "CopieDouble";
|
|
$this->update = '2016-08-17';
|
|
|
|
}
|
|
|
|
|
|
public function collectData(array $param){
|
|
$html = $this->getSimpleHTMLDOM('http://www.copie-double.com/') or $this->returnServerError('Could not request CopieDouble.');
|
|
$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 getCacheDuration(){
|
|
return 14400; // 4 hours
|
|
}
|
|
}
|