2014-07-22 14:55:22 +02:00
|
|
|
<?php
|
|
|
|
class MondeDiploBridge extends BridgeAbstract{
|
|
|
|
|
2016-08-30 11:23:55 +02:00
|
|
|
const MAINTAINER = "Pitchoule";
|
|
|
|
const NAME = 'Monde Diplomatique';
|
|
|
|
const URI = 'http://www.monde-diplomatique.fr/';
|
|
|
|
const DESCRIPTION = "Returns most recent results from MondeDiplo.";
|
2015-11-04 10:47:21 +01:00
|
|
|
|
2016-08-25 01:24:53 +02:00
|
|
|
public function collectData(){
|
2016-09-25 23:22:33 +02:00
|
|
|
$html = getSimpleHTMLDOM(self::URI)
|
|
|
|
or returnServerError('Could not request MondeDiplo. for : ' . self::URI);
|
2016-08-03 21:08:35 +02:00
|
|
|
|
|
|
|
foreach($html->find('div.unarticle') as $article) {
|
|
|
|
$element = $article->parent();
|
2016-08-22 18:55:59 +02:00
|
|
|
$item = array();
|
2016-08-30 11:23:55 +02:00
|
|
|
$item['uri'] = self::URI . $element->href;
|
2016-08-22 18:55:59 +02:00
|
|
|
$item['title'] = $element->find('h3', 0)->plaintext;
|
|
|
|
$item['content'] = $element->find('div.dates_auteurs', 0)->plaintext . '<br>' . strstr($element->find('div', 0)->plaintext, $element->find('div.dates_auteurs', 0)->plaintext, true);
|
2016-08-03 21:08:35 +02:00
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
2014-07-22 14:55:22 +02:00
|
|
|
|
2016-08-03 21:08:35 +02:00
|
|
|
public function getCacheDuration(){
|
|
|
|
return 21600; // 6 hours
|
|
|
|
}
|
2014-07-22 14:55:22 +02:00
|
|
|
}
|