From dd38879204407a959001495e7effe0989cdb4ca0 Mon Sep 17 00:00:00 2001 From: limepotato Date: Thu, 5 Sep 2024 18:22:02 -0600 Subject: [PATCH] separate endpoint --- public/scripts/ntfy.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/scripts/ntfy.js b/public/scripts/ntfy.js index aeae038..deae245 100644 --- a/public/scripts/ntfy.js +++ b/public/scripts/ntfy.js @@ -1,5 +1,6 @@ // i deeply apologize for the horrors within... const ntfyEndpoint = "https://ntfy.ouroboros.group/beep"; +const meowEndpoint = "https://ntfy.ouroboros.group/meow"; const ntfyMessage = document.getElementById("ntfy-message"); const ntfyTitle = document.getElementById("ntfy-title"); @@ -149,7 +150,7 @@ function toggleClick() { async function meowClick() { meowButton.disabled=true; setTimeout('meowButton.disabled=false;',11000); meowButton.innerHTML = "Sent! :3"; - sendNone("meow"); + sendNone(meowEndpoint, "meow"); setTimeout(() => { meowButton.innerHTML = "cooldown 10s"; setTimeout(() => { @@ -203,9 +204,9 @@ async function ntfyClick() { } // only message -function sendNone(message) { +function sendNone(endpoint, message) { const r = new XMLHttpRequest(); - r.open("POST", ntfyEndpoint, true); + r.open("POST", endpoint, true); r.setRequestHeader("Content-Type", "text/plain"); r.send(message); } @@ -327,7 +328,7 @@ function sendNotification() { } // none else { - sendNone(ntfyMessage.value); + sendNone(ntfyEndpoint, ntfyMessage.value); ntfyMessage.value = ""; } }