mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-27 20:12:11 +03:00
30 lines
860 B
PHP
30 lines
860 B
PHP
<?php
|
|
class TheOatmealBridge extends FeedExpander{
|
|
|
|
const MAINTAINER = "Riduidel";
|
|
const NAME = "The Oatmeal";
|
|
const URI = "http://theoatmeal.com/";
|
|
const DESCRIPTION = "Un petit site de dessins assez rigolos";
|
|
|
|
public function collectData(){
|
|
$this->collectExpandableDatas('http://feeds.feedburner.com/oatmealfeed');
|
|
}
|
|
|
|
protected function parseItem($newsItem) {
|
|
$item = $this->parseRSS_1_0_Item($newsItem);
|
|
|
|
$articlePage = $this->getSimpleHTMLDOMCached($item['uri']);
|
|
$content = $articlePage->find('#comic', 0);
|
|
if(is_null($content)) // load alternative
|
|
$content = $articlePage->find('#blog', 0);
|
|
|
|
if(!is_null($content))
|
|
$item['content'] = $content->innertext;
|
|
|
|
return $item;
|
|
}
|
|
|
|
public function getCacheDuration(){
|
|
return 7200; // 2h hours
|
|
}
|
|
}
|