From 30303a3ad0d0f31d93c25f42bfd10d70e8277b72 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 10 Dec 2022 22:27:08 +0100 Subject: Update --- api/camera.php | 6 ++++++ api/pluralkit-integration.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 api/camera.php (limited to 'api') diff --git a/api/camera.php b/api/camera.php new file mode 100644 index 0000000..cbf7efc --- /dev/null +++ b/api/camera.php @@ -0,0 +1,6 @@ + 0) { + file_get_contents('https://' . $ntfy["server"] . '/public-switches-fr', false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 $name vient de switch\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Voir sur Cold Haze, https://fr.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " est désormais au front" + ] + ])); + } else { + file_get_contents('https://' . $ntfy["server"] . '/public-switches-fr', false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 $name vient de switch\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Voir sur Cold Haze, https://fr.equestria.horse/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "Le poney de trait est désormais au front" + ] + ])); + } } else { $topic = "public-switches-cloudburst"; } -- cgit