limepot-xyz/public/scripts/ntfy.js

15 lines
399 B
JavaScript
Raw Permalink Normal View History

2024-07-06 16:45:47 -06:00
// both
function send(message) {
2024-07-13 00:03:34 -06:00
let r = new XMLHttpRequest();
r.open("POST", "https://ntfy.ouroboros.group/beep", true);
r.setRequestHeader("Content-Type", "text/plain");
r.send(message);
}
// send notification
let ntfyInput = document.getElementById("ntfy-input");
function sendNotification() {
if (ntfyInput.value.length <= 0) return;
send(ntfyInput.value);
ntfyInput.value = "";
}