Rss-Bridge/bridges/DansTonChatBridge.php
Pierre Mazière de1b39c8e5 [core + bridges] get rid of loadMetadata
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>
2016-08-28 13:05:03 +02:00

27 lines
899 B
PHP

<?php
class DansTonChatBridge extends BridgeAbstract{
public $maintainer = "Astalaseven";
public $name = "DansTonChat Bridge";
public $uri = "http://danstonchat.com";
public $description = "Returns latest quotes from DansTonChat.";
public function collectData(){
$html = '';
$link = 'http://danstonchat.com/latest.html';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request DansTonChat.');
foreach($html->find('div.item') as $element) {
$item = array();
$item['uri'] = $element->find('a', 0)->href;
$item['title'] = 'DansTonChat '.$element->find('a', 1)->plaintext;
$item['content'] = $element->find('a', 0)->innertext;
$this->items[] = $item;
}
}
public function getCacheDuration(){
return 21600; // 6 hours
}
}