From 4420906a7a06d4283a16e3778e4a053a2874dbb5 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Tue, 2 Aug 2016 15:40:07 +0200 Subject: [PATCH] Fix indentation and remove unnecessary lines --- bridges/DauphineLibereBridge.php | 204 +++++++++++++++---------------- 1 file changed, 101 insertions(+), 103 deletions(-) diff --git a/bridges/DauphineLibereBridge.php b/bridges/DauphineLibereBridge.php index 27f84d76..03c35c63 100644 --- a/bridges/DauphineLibereBridge.php +++ b/bridges/DauphineLibereBridge.php @@ -1,95 +1,94 @@ maintainer = "qwertygc"; - $this->name = "DauphineLibereBridge Bridge"; - $this->uri = "http://www.ledauphine.com/"; - $this->description = "Returns the newest articles."; - $this->update = "2016-08-02"; + $this->maintainer = "qwertygc"; + $this->name = "DauphineLibereBridge Bridge"; + $this->uri = "http://www.ledauphine.com/"; + $this->description = "Returns the newest articles."; + $this->update = "2016-08-02"; + $this->parameters[] = + '[ + { + "name" : "Catégorie de l\'article", + "identifier" : "u", + "type" : "list", + "values" : [ + { + "name" : "À la une", + "value" : "" + }, + { + "name" : "France Monde", + "value" : "france-monde" + }, + { + "name" : "Faits Divers", + "value" : "faits-divers" + }, + { + "name" : "Économie et Finance", + "value" : "economie-et-finance" + }, + { + "name" : "Politique", + "value" : "politique" + }, + { + "name" : "Sport", + "value" : "sport" + }, + { + "name" : "Ain", + "value" : "ain" + }, + { + "name" : "Alpes-de-Haute-Provence", + "value" : "haute-provence" + }, + { + "name" : "Hautes-Alpes", + "value" : "hautes-alpes" + }, + { + "name" : "Ardèche", + "value" : "ardeche" + }, + { + "name" : "Drôme", + "value" : "drome" + }, + { + "name" : "Isère Sud", + "value" : "isere-sud" + }, + { + "name" : "Savoie", + "value" : "savoie" + }, + { + "name" : "Haute-Savoie", + "value" : "haute-savoie" + }, + { + "name" : "Vaucluse", + "value" : "vaucluse" + } + ] + } + ]'; + } - $this->parameters[] = - '[ - { - "name" : "Catégorie de l\'article", - "identifier" : "u", - "type" : "list", - "values" : [ - { - "name" : "À la une", - "value" : "" - }, - { - "name" : "France Monde", - "value" : "france-monde" - }, - { - "name" : "Faits Divers", - "value" : "faits-divers" - }, - { - "name" : "Économie et Finance", - "value" : "economie-et-finance" - }, - { - "name" : "Politique", - "value" : "politique" - }, - { - "name" : "Sport", - "value" : "sport" - }, - { - "name" : "Ain", - "value" : "ain" - }, - { - "name" : "Alpes-de-Haute-Provence", - "value" : "haute-provence" - }, - { - "name" : "Hautes-Alpes", - "value" : "hautes-alpes" - }, - { - "name" : "Ardèche", - "value" : "ardeche" - }, - { - "name" : "Drôme", - "value" : "drome" - }, - { - "name" : "Isère Sud", - "value" : "isere-sud" - }, - { - "name" : "Savoie", - "value" : "savoie" - }, - { - "name" : "Haute-Savoie", - "value" : "haute-savoie" - }, - { - "name" : "Vaucluse", - "value" : "vaucluse" - } - ] - } - ]'; - } - - function ExtractContent($url) { + function ExtractContent($url) { $html2 = $this->file_get_html($url); $text = $html2->find('div.column', 0)->innertext; $text = preg_replace('@]*?>.*?@si', '', $text); return $text; - } + } - public function collectData(array $param){ + public function collectData(array $param){ if (isset($param['u'])) { /* user timeline mode */ $this->request = $param['u']; @@ -101,29 +100,28 @@ class DauphineLibereBridge extends BridgeAbstract{ $limit = 0; foreach($html->find('item') as $element) { - if($limit < 10) { - $item = new \Item(); - $item->title = $element->find('title', 0)->innertext; - $item->uri = $element->find('guid', 0)->plaintext; - $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); - $item->content = $this->ExtractContent($item->uri); - $this->items[] = $item; - $limit++; - } + if($limit < 10) { + $item = new \Item(); + $item->title = $element->find('title', 0)->innertext; + $item->uri = $element->find('guid', 0)->plaintext; + $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); + $item->content = $this->ExtractContent($item->uri); + $this->items[] = $item; + $limit++; + } } - - } + } - public function getName(){ - return 'Dauphine Bridge'; - } + public function getName(){ + return 'Dauphine Bridge'; + } - public function getURI(){ - return 'http://ledauphine.com/'; - } + public function getURI(){ + return 'http://ledauphine.com/'; + } - public function getCacheDuration(){ - return 3600*2; // 2 hours - // return 0; // 2 hours - } + public function getCacheDuration(){ + return 3600*2; // 2 hours + } } +?> \ No newline at end of file