feat: add ctf flag

This commit is contained in:
dd060606
2025-12-08 09:00:49 +01:00
parent 741a1a1f9c
commit 32fff1a82f
2 changed files with 26 additions and 2 deletions

View File

@@ -4,6 +4,11 @@ const apiUrl = "https://calendrier.appen.fr/api/get_day";
// Fonction pour récupérer les données depuis l'API
async function fetchDayData() {
try {
/* Ancienne version
const dateAuj = new Date().toISOString().slice(0, 10).split("-").reverse().join("-");
const apiUrlLegacy = "https://calendrier.appen.fr/api/get_link?date=" + dateAuj;
const response = await fetch(apiUrlLegacy);
*/
const response = await fetch(apiUrl);
if (!response.ok) {
@@ -29,7 +34,7 @@ function initCalendar() {
if (!dayData) return; // Si l'appel API échoue, on ne fait rien
const todayDate = parseInt(dayData.date.split("-")[0], 10); // Extraire le jour de la date (ex : "27")
const link = dayData.link;
@@ -37,7 +42,7 @@ function initCalendar() {
if (link)
showModal(`Voici votre lien du jour : <a href="${link}" target="_blank">${link}</a>`);
else
showModal("Ce lien n'existe pas. Si cela n'est pas normale, veuillez contacter <a href='https://instagram.com/appen_isen'>Appen sur instagram</a>.");
showModal("Ce lien n'existe pas. Si cela n'est pas normale, veuillez contacter <a href='https://instagram.com/appen_isen'>Appen sur instagram</a>.");
} else {
showModal("Ce lien n'est pas encore ou plus disponible !");
}