mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 15:06:53 +00:00
Create BouffonduroiBridge.php
C'est mon premier bridge
This commit is contained in:
parent
9c8a9d1d1d
commit
71317ece89
53
bridges/BouffonduroiBridge.php
Normal file
53
bridges/BouffonduroiBridge.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* RssBridgeBouffonduroi
|
||||
* Retrieve lastest quotes from Bouffonduroi.
|
||||
* Returns the most recent quotes, sorting by date (most recent first).
|
||||
*
|
||||
* @name Bouffonduroi Bridge
|
||||
* @description Returns latest quotes from Bouffonduroi.
|
||||
*/
|
||||
class BouffonduroiBridge extends BridgeAbstract{
|
||||
|
||||
public function collectData(array $param){
|
||||
$html = '';
|
||||
$link = 'http://Bouffonduroi.over-blog.fr/';
|
||||
$html = file_get_html($link) or $this->returnError('Could not request Bouffonduroi.', 404);
|
||||
$data = $html->find('div.article[itemscope=*]');
|
||||
$Cnt = 0;
|
||||
foreach( $data as $element) {
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = $element->find('a', 0)->href;
|
||||
$item->title = 'Bouffonduroi - '.$element->find('a', 0)->plaintext;
|
||||
$item->content = $element->find('a', 0)->innertext;
|
||||
$img = $element->find('img', 0);
|
||||
if (isset($img))
|
||||
{
|
||||
$item->content .= '<br />'.$img;
|
||||
}
|
||||
$video = $element->find('div.contenuArticle iframe', 0)->src;
|
||||
if (isset($video))
|
||||
{
|
||||
$item->content .= '<br /><a href="' . $video . '"> Video !! </a>';
|
||||
}
|
||||
foreach($element->find('div.contenuArticle span') as $contentarticle) {
|
||||
$item->content .= '<br />'.$contentarticle->plaintext;
|
||||
}
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
return 'Bouffonduroi';
|
||||
}
|
||||
|
||||
public function getURI(){
|
||||
return 'http://Bouffonduroi.over-blog.fr/';
|
||||
|
||||
}
|
||||
|
||||
public function getCacheDuration(){
|
||||
return 21600; // 6 hours
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user