Les400Culs.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. define("SEXE", "http://sexes.blogs.liberation.fr");
  3. define("SEXE_FEED", "http://sexes.blogs.liberation.fr/feeds/");
  4. class Les400Culs extends RssExpander{
  5. public function loadMetadatas() {
  6. $this->maintainer = "unknown";
  7. $this->name = "Les 400 Culs";
  8. $this->uri = "http://sexes.blogs.liberation.fr";
  9. $this->description = "La planete sexe vue par Agnes Girard via rss-bridge";
  10. $this->update = "20/02/2014";
  11. }
  12. public function collectData(array $param){
  13. parent::collectExpandableDatas($param, SEXE_FEED);
  14. }
  15. protected function parseRSSItem($newsItem) {
  16. $item = new Item();
  17. $item->title = trim((string) $newsItem->title);
  18. // $this->message("browsing item ".var_export($newsItem, true));
  19. if(empty($newsItem->guid)) {
  20. $item->uri = (string) $newsItem->link;
  21. } else {
  22. $item->uri = (string) $newsItem->guid;
  23. }
  24. // now load that uri from cache
  25. // $this->message("now loading page ".$item->uri);
  26. // $articlePage = str_get_html($this->get_cached($item->uri));
  27. // $content = $articlePage->find('.post-container', 0);
  28. $item->content = (string) $newsItem->description;
  29. $item->name = (string) $newsItem->author;
  30. $item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem);
  31. return $item;
  32. }
  33. public function getCacheDuration(){
  34. return 7200; // 2h hours
  35. }
  36. }