mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 10:04:54 +02:00
Add extra bridges, first batch (So feed, Many RSS)
This commit is contained in:
parent
96b9476d5a
commit
3b558e1c2a
34 changed files with 1911 additions and 0 deletions
55
bridges/AllocineFRBridge.php
Normal file
55
bridges/AllocineFRBridge.php
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @name Allo Cine : Faux Raccord
|
||||
* @homepage http://www.allocine.fr/video/programme-12284/saison-22907/
|
||||
* @description Allo Cine : Faux Raccord
|
||||
* @update 07/11/2013
|
||||
* initial maintainer: superbaillot.net
|
||||
*/
|
||||
class AllocineFRBridge extends BridgeAbstract{
|
||||
|
||||
private $_URL = "http://www.allocine.fr/video/programme-12284/saison-22907/";
|
||||
private $_NOM = "Faux Raccord";
|
||||
|
||||
public function collectData(array $param){
|
||||
$html = file_get_html($this->_URL) or $this->returnError('Could not request Allo cine.', 404);
|
||||
|
||||
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
|
||||
}
|
||||
public function getDescription(){
|
||||
return "Allo Cine : " . $this->_NOM . " via rss-bridge";
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue