forked from blallo/rss-bridge
[Les400Culs] Use internal RSS 2.0 parser
This commit is contained in:
parent
88f52196b8
commit
78050972f4
1 changed files with 8 additions and 24 deletions
|
@ -6,30 +6,14 @@ class Les400CulsBridge extends FeedExpander{
|
||||||
const URI = "http://sexes.blogs.liberation.fr/";
|
const URI = "http://sexes.blogs.liberation.fr/";
|
||||||
const DESCRIPTION = "La planete sexe vue par Agnes Girard via rss-bridge";
|
const DESCRIPTION = "La planete sexe vue par Agnes Girard via rss-bridge";
|
||||||
|
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
$this->collectExpandableDatas(self::URI.'feeds/');
|
$this->collectExpandableDatas(self::URI . 'feeds/');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function parseItem($newsItem) {
|
protected function parseItem($newsItem){
|
||||||
$item = array();
|
return $this->parseRSS_2_0_Item($newsItem);
|
||||||
$item['title'] = trim((string) $newsItem->title);
|
|
||||||
$this->debugMessage("browsing item ".var_export($newsItem, true));
|
|
||||||
if(empty($newsItem->guid)) {
|
|
||||||
$item['uri'] = (string) $newsItem->link;
|
|
||||||
} else {
|
|
||||||
$item['uri'] = (string) $newsItem->guid;
|
|
||||||
}
|
}
|
||||||
// now load that uri from cache
|
|
||||||
$this->debugMessage("now loading page ".$item['uri']);
|
|
||||||
// $articlePage = $this->get_cached($item['uri']);
|
|
||||||
|
|
||||||
// $content = $articlePage->find('.post-container', 0);
|
|
||||||
$item['content'] = (string) $newsItem->description;
|
|
||||||
$item['author'] = (string) $newsItem->author;
|
|
||||||
$item['timestamp'] = $this->RSS_2_0_time_to_timestamp($newsItem);
|
|
||||||
return $item;
|
|
||||||
}
|
|
||||||
public function getCacheDuration(){
|
public function getCacheDuration(){
|
||||||
return 7200; // 2h hours
|
return 7200; // 2h hours
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue