From 59d3011c866499f6c43af133fc225afd0e627191 Mon Sep 17 00:00:00 2001 From: Julien Papasian Date: Thu, 8 Dec 2022 20:48:10 +0100 Subject: [PATCH] Add Nautiljon bridge (#3181) --- bridges/NautiljonBridge.php | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 bridges/NautiljonBridge.php diff --git a/bridges/NautiljonBridge.php b/bridges/NautiljonBridge.php new file mode 100644 index 00000000..611ffc2f --- /dev/null +++ b/bridges/NautiljonBridge.php @@ -0,0 +1,55 @@ + [ + 'type' => 'list', + 'name' => 'Type', + 'title' => 'Choisir le type', + 'values' => [ + 'Actualités' => 'actualite', + 'Brèves' => 'breves', + ], + ] + ] + ]; + + private function formatDate($fright) + { + preg_match('#^(.*)(.*)getInput('type')); + $dom = getSimpleHTMLDOM($url); + + foreach ($dom->find('div.une_actu') as $article) { + $fright = $article->find('span.fright', 0); + $this->items[] = [ + 'title' => $article->find('h3 a', 0)->plaintext, + 'uri' => self::URI . $article->find('h3 a', 0)->href, + 'content' => $article->find('p', 0)->plaintext, + 'author' => $fright->find('a', 0)->plaintext, + 'categories' => [($fright->find('a')[1])->plaintext], + 'enclosures' => [self::URI . $article->find('a img', 0)->src], + 'timestamp' => $this->formatDate($article->find('span.fright', 0)), + ]; + } + } +}