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
|
|
|
|
2016-08-24 19:06:07 +02:00
|
|
|
class Les400CulsBridge 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";
|
2015-11-03 23:28:44 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-08-25 01:24:53 +02:00
|
|
|
public function collectData(){
|
|
|
|
$param=$this->parameters[$this->queriedContext];
|
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) {
|
2016-08-22 18:55:59 +02:00
|
|
|
$item = array();
|
|
|
|
$item['title'] = trim((string) $newsItem->title);
|
2016-08-24 20:19:30 +02:00
|
|
|
$this->debugMessage("browsing item ".var_export($newsItem, true));
|
2015-03-18 17:42:55 +01:00
|
|
|
if(empty($newsItem->guid)) {
|
2016-08-22 18:55:59 +02:00
|
|
|
$item['uri'] = (string) $newsItem->link;
|
2015-03-18 17:42:55 +01:00
|
|
|
} else {
|
2016-08-22 18:55:59 +02:00
|
|
|
$item['uri'] = (string) $newsItem->guid;
|
2015-03-18 17:42:55 +01:00
|
|
|
}
|
|
|
|
// now load that uri from cache
|
2016-08-24 20:19:30 +02:00
|
|
|
$this->debugMessage("now loading page ".$item['uri']);
|
2016-08-22 18:55:59 +02:00
|
|
|
// $articlePage = str_get_html($this->get_cached($item['uri']));
|
2015-03-18 17:42:55 +01:00
|
|
|
|
|
|
|
// $content = $articlePage->find('.post-container', 0);
|
2016-08-22 18:55:59 +02:00
|
|
|
$item['content'] = (string) $newsItem->description;
|
|
|
|
$item['author'] = (string) $newsItem->author;
|
|
|
|
$item['timestamp'] = $this->RSS_2_0_time_to_timestamp($newsItem);
|
2015-03-18 17:42:55 +01:00
|
|
|
return $item;
|
2014-02-20 08:43:14 +01:00
|
|
|
}
|
|
|
|
public function getCacheDuration(){
|
|
|
|
return 7200; // 2h hours
|
|
|
|
}
|
|
|
|
}
|