From 9e78ec86340b5d37e9685f8ad3c294f7b955133a Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Tue, 4 Jun 2024 09:42:41 +0200 Subject: [PATCH] small fix and refactor --- epub.php | 74 +++++++++++++++++++++--------------------------------- index.html | 6 ++--- 2 files changed, 32 insertions(+), 48 deletions(-) diff --git a/epub.php b/epub.php index 01d6fbd..4fc270d 100644 --- a/epub.php +++ b/epub.php @@ -1,4 +1,9 @@ + + + Fichiers epub + + error ) { + $epub->CreateEPUB(); + + if ( ! $epub->error ) { + echo 'Success: ' . $epub->epub_file . ' created.
'; + } + else + { + echo $epub->error; + } + + } else { + echo $epub->error; + } + } + date_default_timezone_set('Europe/Paris'); $date = (new DateTime('today'))->format('Ymd'); @@ -97,21 +120,7 @@ $epub->AddPage($pagecontent, false, strip_tags($articlebody->Title)); } } - - if ( ! $epub->error ) { - $epub->CreateEPUB(); - - if ( ! $epub->error ) { - echo 'Success: ' . $epub->epub_file . ' created.
'; - } - else - { - echo $epub->error; - } - - } else { - echo $epub->error; - } + write_epub($epub); } // Mediapart @@ -199,20 +208,7 @@ } } - if ( ! $epub->error ) { - $epub->CreateEPUB(); - - if ( ! $epub->error ) { - echo 'Success: ' . $epub->epub_file . ' created.
'; - } - else - { - echo $epub->error; - } - - } else { - echo $epub->error; - } + write_epub($epub); } // New York Times @@ -301,30 +297,18 @@ } } - if ( ! $epub->error ) { - $epub->CreateEPUB(); - - if ( ! $epub->error ) { - echo 'Success: ' . $epub->epub_file . ' created.
'; - } - else - { - echo $epub->error; - } - - } else { - echo $epub->error; - } + write_epub($epub); } // list existing files + echo '
'; $files = glob('epub/*'); foreach ($files as $file) { - echo '' . $file . ' ' . date('F d Y H:i:s', filemtime($file)) . '
'; + echo '' . str_replace('epub/', '', $file) . ' ' . date('F d Y H:i:s', filemtime($file)) . '
'; } - + echo '
'; ?>
diff --git a/index.html b/index.html index 6015b86..dfd4b80 100644 --- a/index.html +++ b/index.html @@ -38,15 +38,15 @@ Lundi matin
Terrestres
Basta!
- The conversation
+ The Conversation
The Guardian
The intercept

Ressources

Revue de presse Basta
- Europresse : - Publications PDF + Connexion Europresse + - Publications PDF - Le Monde
Cairn - Écologie & politique