From e95b208af90cc386a7d8d1bcab426727cf4f0121 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 21 Sep 2022 22:42:33 +0200 Subject: Update time --- api/cloudburst-banners.php | 1 + api/docs.php | 31 +++++++++++++++++++++++++++++++ api/pleasure-real.php | 14 +++++++++++++- api/pleasure.php | 14 +++++++++++++- api/pluralkit-integration.php | 20 ++++++++++++++++++++ api/raindrops-banners.php | 1 + api/raindrops-img.php | 10 ++++++++++ api/save-private.php | 43 +++++++++++++++++++++++++++++++++++++++++++ api/wakeup-real.php | 28 ++++++++++++++++++++++++++++ api/wakeup.php | 28 ++++++++++++++++++++++++++++ 10 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 api/docs.php create mode 100644 api/raindrops-img.php create mode 100644 api/save-private.php create mode 100644 api/wakeup-real.php create mode 100644 api/wakeup.php (limited to 'api') diff --git a/api/cloudburst-banners.php b/api/cloudburst-banners.php index 32b47fa..8bbd575 100644 --- a/api/cloudburst-banners.php +++ b/api/cloudburst-banners.php @@ -10,6 +10,7 @@ $data = []; foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { if ($member['name'] === "unknown") continue; if ($member['name'] === "fusion") continue; + if ($member['name'] === "new") continue; $data[$member['name']] = getMemberBannerData($member['id'], "ynmuc"); } diff --git a/api/docs.php b/api/docs.php new file mode 100644 index 0000000..edcd4fb --- /dev/null +++ b/api/docs.php @@ -0,0 +1,31 @@ + [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🐴 Switch occurred in the $name\r\n" . + "Priority: default\r\n" . + "Tags: switch\r\n" . + "Actions: view, Open on Cold Haze, https://ponies.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"]) . " switched in just now" + ] + ])); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data.json-res", "affected: " . $input["type"] . " (" . gettype($input["type"]) . ")") and die(); } else { file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data.json-res", "invalid method: " . $input["type"] . " (" . gettype($input["type"]) . ")") and die(); diff --git a/api/raindrops-banners.php b/api/raindrops-banners.php index f42426a..b2a5ef4 100644 --- a/api/raindrops-banners.php +++ b/api/raindrops-banners.php @@ -10,6 +10,7 @@ $data = []; foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { if ($member['name'] === "unknown") continue; if ($member['name'] === "fusion") continue; + if ($member['name'] === "new") continue; $data[$member['name']] = getMemberBannerData($member['id'], "gdapd"); } diff --git a/api/raindrops-img.php b/api/raindrops-img.php new file mode 100644 index 0000000..3b24d97 --- /dev/null +++ b/api/raindrops-img.php @@ -0,0 +1,10 @@ + [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: 🥱 Wake up!\r\n" . + "Priority: high\r\n" . + "Tags: wakeup\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "Hey, $pony wants you to wake up!" + ] +])); + +die(); \ No newline at end of file diff --git a/api/wakeup.php b/api/wakeup.php new file mode 100644 index 0000000..7eb96c3 --- /dev/null +++ b/api/wakeup.php @@ -0,0 +1,28 @@ + [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: [Test] 🥱 Wake up!\r\n" . + "Priority: high\r\n" . + "Tags: wakeup\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), + 'content' => "[This notification is test] Hey, $pony wants you to wake up! [This notification is test]" + ] +])); + +die(); \ No newline at end of file -- cgit