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