CopieDoubleBridge.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. *
  4. * @name CopieDouble
  5. * @homepage http://www.copie-double.com/
  6. * @description CopieDouble
  7. * @update 12/12/2013
  8. * initial maintainer: superbaillot.net
  9. */
  10. class CopieDoubleBridge extends BridgeAbstract{
  11. public function collectData(array $param){
  12. $html = file_get_html('http://www.copie-double.com/') or $this->returnError('Could not request CopieDouble.', 404);
  13. $table = $html->find('table table', 2);
  14. foreach($table->find('tr') as $element)
  15. {
  16. $td = $element->find('td', 0);
  17. $cpt++;
  18. if($td->class == "couleur_1")
  19. {
  20. $item = new Item();
  21. $title = $td->innertext;
  22. $pos = strpos($title, "<a");
  23. $title = substr($title, 0, $pos);
  24. $item->title = $title;
  25. }
  26. elseif(strpos($element->innertext, "/images/suivant.gif") === false)
  27. {
  28. $a=$element->find("a", 0);
  29. $item->uri = "http://www.copie-double.com" . $a->href;
  30. $content = str_replace('src="/', 'src="http://www.copie-double.com/',$element->find("td", 0)->innertext);
  31. $content = str_replace('href="/', 'href="http://www.copie-double.com/',$content);
  32. $item->content = $content;
  33. $this->items[] = $item;
  34. }
  35. }
  36. }
  37. public function getName(){
  38. return 'CopieDouble';
  39. }
  40. public function getURI(){
  41. return 'http://www.copie-double.com';
  42. }
  43. public function getDescription(){
  44. return 'CopieDouble via rss-bridge';
  45. }
  46. public function getCacheDuration(){
  47. return 14400; // 4 hours
  48. }
  49. }
  50. ?>