2014-02-20 11:43:14 +04:00
|
|
|
<?php
|
|
|
|
define("SEXE", "http://sexes.blogs.liberation.fr");
|
2015-11-04 02:05:10 +03:00
|
|
|
define("SEXE_FEED", "http://sexes.blogs.liberation.fr/feeds/");
|
2015-11-05 23:26:48 +03:00
|
|
|
|
2016-08-24 20:06:07 +03:00
|
|
|
class Les400CulsBridge extends RssExpander{
|
2014-02-20 11:43:14 +04:00
|
|
|
|
2015-11-04 01:28:44 +03:00
|
|
|
public function loadMetadatas() {
|
|
|
|
|
|
|
|
$this->maintainer = "unknown";
|
|
|
|
$this->name = "Les 400 Culs";
|
|
|
|
$this->uri = "http://sexes.blogs.liberation.fr";
|
2016-04-13 22:22:09 +03:00
|
|
|
$this->description = "La planete sexe vue par Agnes Girard via rss-bridge";
|
2015-11-04 01:28:44 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-02-20 11:43:14 +04:00
|
|
|
public function collectData(array $param){
|
2015-11-05 23:26:48 +03:00
|
|
|
parent::collectExpandableDatas($param, SEXE_FEED);
|
2014-02-20 11:43:14 +04:00
|
|
|
}
|
2015-03-18 19:42:55 +03:00
|
|
|
|
|
|
|
protected function parseRSSItem($newsItem) {
|
2016-08-22 19:55:59 +03:00
|
|
|
$item = array();
|
|
|
|
$item['title'] = trim((string) $newsItem->title);
|
2016-08-24 21:19:30 +03:00
|
|
|
$this->debugMessage("browsing item ".var_export($newsItem, true));
|
2015-03-18 19:42:55 +03:00
|
|
|
if(empty($newsItem->guid)) {
|
2016-08-22 19:55:59 +03:00
|
|
|
$item['uri'] = (string) $newsItem->link;
|
2015-03-18 19:42:55 +03:00
|
|
|
} else {
|
2016-08-22 19:55:59 +03:00
|
|
|
$item['uri'] = (string) $newsItem->guid;
|
2015-03-18 19:42:55 +03:00
|
|
|
}
|
|
|
|
// now load that uri from cache
|
2016-08-24 21:19:30 +03:00
|
|
|
$this->debugMessage("now loading page ".$item['uri']);
|
2016-08-22 19:55:59 +03:00
|
|
|
// $articlePage = str_get_html($this->get_cached($item['uri']));
|
2015-03-18 19:42:55 +03:00
|
|
|
|
|
|
|
// $content = $articlePage->find('.post-container', 0);
|
2016-08-22 19:55:59 +03:00
|
|
|
$item['content'] = (string) $newsItem->description;
|
|
|
|
$item['author'] = (string) $newsItem->author;
|
|
|
|
$item['timestamp'] = $this->RSS_2_0_time_to_timestamp($newsItem);
|
2015-03-18 19:42:55 +03:00
|
|
|
return $item;
|
2014-02-20 11:43:14 +04:00
|
|
|
}
|
|
|
|
public function getCacheDuration(){
|
|
|
|
return 7200; // 2h hours
|
|
|
|
}
|
|
|
|
}
|