mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-09-03 05:02:43 +02:00
Reformat codebase v4 (#2872)
Reformat code base to PSR12 Co-authored-by: rssbridge <noreply@github.com>
This commit is contained in:
@@ -1,57 +1,61 @@
|
||||
<?php
|
||||
class DauphineLibereBridge extends FeedExpander {
|
||||
|
||||
const MAINTAINER = 'qwertygc';
|
||||
const NAME = 'Dauphine Bridge';
|
||||
const URI = 'https://www.ledauphine.com/';
|
||||
const CACHE_TIMEOUT = 7200; // 2h
|
||||
const DESCRIPTION = 'Returns the newest articles.';
|
||||
class DauphineLibereBridge extends FeedExpander
|
||||
{
|
||||
const MAINTAINER = 'qwertygc';
|
||||
const NAME = 'Dauphine Bridge';
|
||||
const URI = 'https://www.ledauphine.com/';
|
||||
const CACHE_TIMEOUT = 7200; // 2h
|
||||
const DESCRIPTION = 'Returns the newest articles.';
|
||||
|
||||
const PARAMETERS = array( array(
|
||||
'u' => array(
|
||||
'name' => 'Catégorie de l\'article',
|
||||
'type' => 'list',
|
||||
'values' => array(
|
||||
'À la une' => '',
|
||||
'France Monde' => 'france-monde',
|
||||
'Faits Divers' => 'faits-divers',
|
||||
'Économie et Finance' => 'economie-et-finance',
|
||||
'Politique' => 'politique',
|
||||
'Sport' => 'sport',
|
||||
'Ain' => 'ain',
|
||||
'Alpes-de-Haute-Provence' => 'haute-provence',
|
||||
'Hautes-Alpes' => 'hautes-alpes',
|
||||
'Ardèche' => 'ardeche',
|
||||
'Drôme' => 'drome',
|
||||
'Isère Sud' => 'isere-sud',
|
||||
'Savoie' => 'savoie',
|
||||
'Haute-Savoie' => 'haute-savoie',
|
||||
'Vaucluse' => 'vaucluse'
|
||||
)
|
||||
)
|
||||
));
|
||||
const PARAMETERS = [ [
|
||||
'u' => [
|
||||
'name' => 'Catégorie de l\'article',
|
||||
'type' => 'list',
|
||||
'values' => [
|
||||
'À la une' => '',
|
||||
'France Monde' => 'france-monde',
|
||||
'Faits Divers' => 'faits-divers',
|
||||
'Économie et Finance' => 'economie-et-finance',
|
||||
'Politique' => 'politique',
|
||||
'Sport' => 'sport',
|
||||
'Ain' => 'ain',
|
||||
'Alpes-de-Haute-Provence' => 'haute-provence',
|
||||
'Hautes-Alpes' => 'hautes-alpes',
|
||||
'Ardèche' => 'ardeche',
|
||||
'Drôme' => 'drome',
|
||||
'Isère Sud' => 'isere-sud',
|
||||
'Savoie' => 'savoie',
|
||||
'Haute-Savoie' => 'haute-savoie',
|
||||
'Vaucluse' => 'vaucluse'
|
||||
]
|
||||
]
|
||||
]];
|
||||
|
||||
public function collectData(){
|
||||
$url = self::URI . 'rss';
|
||||
public function collectData()
|
||||
{
|
||||
$url = self::URI . 'rss';
|
||||
|
||||
if(empty($this->getInput('u'))) {
|
||||
$url = self::URI . $this->getInput('u') . '/rss';
|
||||
}
|
||||
if (empty($this->getInput('u'))) {
|
||||
$url = self::URI . $this->getInput('u') . '/rss';
|
||||
}
|
||||
|
||||
$this->collectExpandableDatas($url, 10);
|
||||
}
|
||||
$this->collectExpandableDatas($url, 10);
|
||||
}
|
||||
|
||||
protected function parseItem($newsItem){
|
||||
$item = parent::parseItem($newsItem);
|
||||
$item['content'] = $this->extractContent($item['uri']);
|
||||
return $item;
|
||||
}
|
||||
protected function parseItem($newsItem)
|
||||
{
|
||||
$item = parent::parseItem($newsItem);
|
||||
$item['content'] = $this->extractContent($item['uri']);
|
||||
return $item;
|
||||
}
|
||||
|
||||
private function extractContent($url){
|
||||
$html2 = getSimpleHTMLDOMCached($url);
|
||||
foreach ($html2->find('.noprint, link, script, iframe, .shareTool, .contentInfo') as $remove) {
|
||||
$remove->outertext = '';
|
||||
}
|
||||
return $html2->find('div.content', 0)->innertext;
|
||||
}
|
||||
private function extractContent($url)
|
||||
{
|
||||
$html2 = getSimpleHTMLDOMCached($url);
|
||||
foreach ($html2->find('.noprint, link, script, iframe, .shareTool, .contentInfo') as $remove) {
|
||||
$remove->outertext = '';
|
||||
}
|
||||
return $html2->find('div.content', 0)->innertext;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user