15 lines
399 B
JavaScript
15 lines
399 B
JavaScript
|
// both
|
||
|
function send(message) {
|
||
|
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 = "";
|
||
|
}
|