diff --git a/cron/generate_journees_mondiales.php b/cron/generate_journees_mondiales.php index 55f2e71..3175c6b 100644 --- a/cron/generate_journees_mondiales.php +++ b/cron/generate_journees_mondiales.php @@ -1,17 +1,13 @@ 'janvier', 'February' => 'février', 'March' => 'mars', 'April' => 'avril', 'May' => 'mai', 'June' => 'juin', 'July' => 'juillet', @@ -19,18 +15,14 @@ $monthsTranslation = [ 'November' => 'novembre', 'December' => 'décembre' ]; -// Get today's date in French $currentDate = date("j F"); $currentDateParts = explode(' ', $currentDate); $currentDay = $currentDateParts[0]; $currentMonth = $monthsTranslation[$currentDateParts[1]] ?? $currentDateParts[1]; $currentDateFr = $currentDay . ' ' . $currentMonth; -// Fetch and parse events from the webpage $html = file_get_contents($eventsUrl); -if (!$html) { - die("Erreur : Impossible de récupérer les événements depuis $eventsUrl"); -} +if (!$html) die; preg_match_all( '/]*>]*>