mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-12-18 00:43:19 +03:00
de1b39c8e5
if a bridge needs to modify some of the data that were initialized there, ::__construct() should be used instead. Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
28 lines
1,000 B
PHP
28 lines
1,000 B
PHP
<?php
|
|
class FierPandaBridge extends BridgeAbstract {
|
|
|
|
public $maintainer = "snroki";
|
|
public $name = "Fier Panda Bridge";
|
|
public $uri = "http://www.fier-panda.fr/";
|
|
public $description = "Returns latest articles from Fier Panda.";
|
|
|
|
public function collectData(){
|
|
$link = 'http://www.fier-panda.fr/';
|
|
|
|
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request Fier Panda.');
|
|
|
|
foreach($html->find('div.container-content article') as $element) {
|
|
$item = array();
|
|
$item['uri'] = $this->getURI().$element->find('a', 0)->href;
|
|
$item['title'] = trim($element->find('h2 a', 0)->innertext);
|
|
// Remove the link at the end of the article
|
|
$element->find('p a', 0)->outertext = '';
|
|
$item['content'] = $element->find('p', 0)->innertext;
|
|
$this->items[] = $item;
|
|
}
|
|
}
|
|
|
|
public function getCacheDuration(){
|
|
return 21600; // 6 hours
|
|
}
|
|
}
|