1
0

AllocineTueursEnSerieBridge.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. *
  4. * @name Allo Cine : Tueurs En Serie
  5. * @homepage http://www.allocine.fr/video/programme-12286/saison-22938/
  6. * @description Allo Cine : Tueurs En Serie
  7. * @update 12/11/2013
  8. * initial maintainer: superbaillot.net
  9. */
  10. class AllocineTueursEnSerieBridge extends BridgeAbstract{
  11. private $_URL = "http://www.allocine.fr/video/programme-12286/saison-22938/";
  12. private $_NOM = "Tueurs en Séries";
  13. public function collectData(array $param){
  14. $html = file_get_html($this->_URL) or $this->returnError('Could not request Allo cine.', 404);
  15. foreach($html->find('figure.media-meta-fig') as $element)
  16. {
  17. $item = new Item();
  18. $titre = $element->find('div.titlebar h3.title a', 0);
  19. $content = trim($element->innertext);
  20. $figCaption = strpos($content, $this->_NOM);
  21. if($figCaption !== false)
  22. {
  23. $content = str_replace('src="/', 'src="http://www.allocine.fr/',$content);
  24. $content = str_replace('href="/', 'href="http://www.allocine.fr/',$content);
  25. $content = str_replace('src=\'/', 'src=\'http://www.allocine.fr/',$content);
  26. $content = str_replace('href=\'/', 'href=\'http://www.allocine.fr/',$content);
  27. $item->content = $content;
  28. $item->title = trim($titre->innertext);
  29. $item->uri = "http://www.allocine.fr" . $titre->href;
  30. $this->items[] = $item;
  31. }
  32. }
  33. }
  34. public function getName(){
  35. return 'Allo Cine : ' . $this->_NOM;
  36. }
  37. public function getURI(){
  38. return $this->_URL;
  39. }
  40. public function getCacheDuration(){
  41. return 25200; // 7 hours
  42. }
  43. public function getDescription(){
  44. return "Allo Cine : " . $this->_NOM . " via rss-bridge";
  45. }
  46. }
  47. ?>