FierPandaBridge.php 895 B

1234567891011121314151617181920212223
  1. <?php
  2. class FierPandaBridge extends BridgeAbstract {
  3. const MAINTAINER = "snroki";
  4. const NAME = "Fier Panda Bridge";
  5. const URI = "http://www.fier-panda.fr/";
  6. const CACHE_TIMEOUT = 21600; // 6h
  7. const DESCRIPTION = "Returns latest articles from Fier Panda.";
  8. public function collectData(){
  9. $html = getSimpleHTMLDOM(self::URI) or returnServerError('Could not request Fier Panda.');
  10. foreach($html->find('div.container-content article') as $element) {
  11. $item = array();
  12. $item['uri'] = $this->getURI().$element->find('a', 0)->href;
  13. $item['title'] = trim($element->find('h1 a', 0)->innertext);
  14. // Remove the link at the end of the article
  15. $element->find('p a', 0)->outertext = '';
  16. $item['content'] = $element->find('p', 0)->innertext;
  17. $this->items[] = $item;
  18. }
  19. }
  20. }