1
0
Fork 0
forked from blallo/rss-bridge
rss-bridge/bridges/Rue89Bridge.php
LogMANOriginal 193ca87afa [phpcs] enforce single quotes (#732)
* [phpcs] Add rule to enforce single quoted strings
2018-06-29 22:55:33 +01:00

25 lines
656 B
PHP

<?php
class Rue89Bridge extends FeedExpander {
const MAINTAINER = 'pit-fgfjiudghdf';
const NAME = 'Rue89';
const URI = 'http://rue89.nouvelobs.com/';
const DESCRIPTION = 'Returns the 5 newest posts from Rue89 (full text)';
protected function parseItem($item){
$item = parent::parseItem($item);
$url = 'http://api.rue89.nouvelobs.com/export/mobile2/node/'
. str_replace(' ', '', substr($item['uri'], -8))
. '/full';
$datas = json_decode(getContents($url), true);
$item['content'] = $datas['node']['body'];
return $item;
}
public function collectData(){
$this->collectExpandableDatas('http://api.rue89.nouvelobs.com/feed');
}
}