2014-05-26 00:30:46 +02:00
|
|
|
<?php
|
|
|
|
class AllocineT5Bridge extends BridgeAbstract{
|
|
|
|
|
|
|
|
private $_URL = "http://www.allocine.fr/video/programme-12299/saison-22542/";
|
|
|
|
private $_NOM = "Top 5";
|
2015-11-05 16:50:18 +01:00
|
|
|
|
|
|
|
public function loadMetadatas() {
|
|
|
|
|
|
|
|
$this->maintainer = "superbaillot.net";
|
|
|
|
$this->name = "Allo Cine : Top 5";
|
|
|
|
$this->uri = "http://www.allocine.fr/video/programme-12299/saison-22542/";
|
|
|
|
$this->description = "Allo Cine : Top 5 via rss-bridge";
|
2016-08-06 16:00:56 +02:00
|
|
|
$this->update = "2016-08-06";
|
2015-11-05 16:50:18 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-05-26 00:30:46 +02:00
|
|
|
public function collectData(array $param){
|
2016-06-25 23:17:42 +02:00
|
|
|
$html = $this->file_get_html($this->_URL) or $this->returnError('Could not request Allo cine.', 404);
|
2014-05-26 00:30:46 +02:00
|
|
|
|
|
|
|
foreach($html->find('figure.media-meta-fig') as $element)
|
|
|
|
{
|
|
|
|
$item = new Item();
|
|
|
|
|
|
|
|
$titre = $element->find('div.titlebar h3.title a', 0);
|
|
|
|
$content = trim($element->innertext);
|
|
|
|
|
|
|
|
$figCaption = strpos($content, $this->_NOM);
|
|
|
|
if($figCaption !== false)
|
|
|
|
{
|
|
|
|
$content = str_replace('src="/', 'src="http://www.allocine.fr/',$content);
|
|
|
|
$content = str_replace('href="/', 'href="http://www.allocine.fr/',$content);
|
|
|
|
$content = str_replace('src=\'/', 'src=\'http://www.allocine.fr/',$content);
|
|
|
|
$content = str_replace('href=\'/', 'href=\'http://www.allocine.fr/',$content);
|
|
|
|
$item->content = $content;
|
|
|
|
$item->title = trim($titre->innertext);
|
|
|
|
$item->uri = "http://www.allocine.fr" . $titre->href;
|
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName(){
|
|
|
|
return 'Allo Cine : ' . $this->_NOM;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getURI(){
|
|
|
|
return $this->_URL;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCacheDuration(){
|
|
|
|
return 25200; // 7 hours
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|