2014-02-20 11:43:14 +04:00
|
|
|
<?php
|
2015-03-18 19:42:55 +03:00
|
|
|
require_once 'bridges/RssExpander.php';
|
2014-02-20 11:43:14 +04:00
|
|
|
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-03-18 19:42:55 +03:00
|
|
|
/**
|
|
|
|
* As it seems that Les 400 culs currently offer a full feed, we won't change it content here.
|
|
|
|
* But I'm ready for the day where it will ... again ... provide some truncated content
|
|
|
|
*/
|
|
|
|
class Les400Culs 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";
|
|
|
|
$this->description = "La planète sexe vue par Agnès Girard via rss-bridge";
|
|
|
|
$this->update = "20/02/2014";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-02-20 11:43:14 +04:00
|
|
|
public function collectData(array $param){
|
2015-11-04 02:05:10 +03:00
|
|
|
$param['url'] = SEXE_FEED;
|
2015-03-18 19:42:55 +03:00
|
|
|
parent::collectData($param);
|
2014-02-20 11:43:14 +04:00
|
|
|
}
|
2015-03-18 19:42:55 +03:00
|
|
|
|
|
|
|
protected function parseRSSItem($newsItem) {
|
|
|
|
$item = new Item();
|
|
|
|
$item->title = trim($newsItem->title);
|
|
|
|
// $this->message("browsing item ".var_export($newsItem, true));
|
|
|
|
if(empty($newsItem->guid)) {
|
|
|
|
$item->uri = $newsItem->link;
|
|
|
|
} else {
|
|
|
|
$item->uri = $newsItem->guid;
|
|
|
|
}
|
|
|
|
// 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);
|
|
|
|
$item->content = $newsItem->description;
|
|
|
|
$item->name = $newsItem->author;
|
|
|
|
$item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem);
|
|
|
|
return $item;
|
2014-02-20 11:43:14 +04:00
|
|
|
}
|
|
|
|
public function getCacheDuration(){
|
|
|
|
return 7200; // 2h hours
|
|
|
|
}
|
|
|
|
}
|