Les400Culs.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. *
  4. * @name Les 400 Culs
  5. * @description La planète sexe vue par Agnès Girard via rss-bridge
  6. * @update 20/02/2014
  7. */
  8. require_once 'bridges/RssExpander.php';
  9. define("SEXE", "http://sexes.blogs.liberation.fr");
  10. define("RSS", "http://sexes.blogs.liberation.fr/feeds/");
  11. /**
  12. * As it seems that Les 400 culs currently offer a full feed, we won't change it content here.
  13. * But I'm ready for the day where it will ... again ... provide some truncated content
  14. */
  15. class Les400Culs extends RssExpander{
  16. public function collectData(array $param){
  17. $param['url'] = RSS;
  18. parent::collectData($param);
  19. }
  20. protected function parseRSSItem($newsItem) {
  21. $item = new Item();
  22. $item->title = trim($newsItem->title);
  23. // $this->message("browsing item ".var_export($newsItem, true));
  24. if(empty($newsItem->guid)) {
  25. $item->uri = $newsItem->link;
  26. } else {
  27. $item->uri = $newsItem->guid;
  28. }
  29. // now load that uri from cache
  30. // $this->message("now loading page ".$item->uri);
  31. // $articlePage = str_get_html($this->get_cached($item->uri));
  32. // $content = $articlePage->find('.post-container', 0);
  33. $item->content = $newsItem->description;
  34. $item->name = $newsItem->author;
  35. $item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem);
  36. return $item;
  37. }
  38. public function getCacheDuration(){
  39. return 7200; // 2h hours
  40. }
  41. }