1
0
Fork 0
forked from blallo/rss-bridge
rss-bridge/bridges/TheOatMealBridge.php

31 lines
850 B
PHP
Raw Normal View History

<?php
class TheOatmealBridge extends RssExpander{
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 parseRSSItem($newsItem) {
2016-09-04 13:17:28 +02:00
$item = $this->parseRSS_1_0_Item($newsItem);
2016-09-04 13:17:28 +02:00
$articlePage = $this->get_cached($item['uri']);
$content = $articlePage->find('#comic', 0);
2016-09-04 13:17:28 +02:00
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
}
}