diff --git a/script.js b/script.js index 29e81c2..530b79d 100644 --- a/script.js +++ b/script.js @@ -41,4 +41,15 @@ const form = document.getElementById('merge-form'); }); }); const refreshInterval = 60 * 60 * 1000; // 1 hour + setInterval(() => { + fetch('/merge') + .then((response) => response.json()) + .then((data) => { + result.innerHTML = `Merged calendar URL: ${data.url}`; + }) + .catch((error) => { + console.error(error); + result.innerHTML = 'Error merging calendars'; + }); + }, refreshInterval); \ No newline at end of file