2014-05-31 12:39:35 +02:00
|
|
|
<?php
|
2016-09-14 13:33:38 +02:00
|
|
|
class Rue89Bridge extends FeedExpander {
|
2015-11-05 12:20:11 +01:00
|
|
|
|
2016-08-30 11:23:55 +02:00
|
|
|
const MAINTAINER = "pit-fgfjiudghdf";
|
|
|
|
const NAME = "Rue89";
|
|
|
|
const URI = "http://rue89.nouvelobs.com/";
|
|
|
|
const DESCRIPTION = "Returns the 5 newest posts from Rue89 (full text)";
|
2015-11-05 12:20:11 +01:00
|
|
|
|
2016-09-14 13:33:38 +02:00
|
|
|
protected function parseItem($item){
|
|
|
|
$item = parent::parseItem($item);
|
2016-06-21 23:33:51 +02:00
|
|
|
|
2016-09-14 13:33:38 +02:00
|
|
|
$url = "http://api.rue89.nouvelobs.com/export/mobile2/node/" . str_replace(" ", "", substr($item['uri'], -8)) . "/full";
|
2016-08-22 23:39:40 +02:00
|
|
|
$datas = json_decode($this->getContents($url), true);
|
2016-09-14 13:33:38 +02:00
|
|
|
$item['content'] = $datas['node']['body'];
|
2016-06-21 23:33:51 +02:00
|
|
|
|
2016-09-14 13:33:38 +02:00
|
|
|
return $item;
|
2015-01-30 19:56:55 +01:00
|
|
|
}
|
|
|
|
|
2016-08-25 01:24:53 +02:00
|
|
|
public function collectData(){
|
2016-09-14 13:33:38 +02:00
|
|
|
$this->collectExpandableDatas('http://api.rue89.nouvelobs.com/feed');
|
2014-05-31 12:39:35 +02:00
|
|
|
}
|
|
|
|
}
|