From 31fed783e82dd065c71b234ba08ece596a081f05 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 17 Dec 2023 12:23:19 +0100 Subject: Updated 15 files and deleted 3 files (automated) --- pages/api/emergency-real.php | 31 ++++++++++++++----------------- pages/api/emergency.php | 31 ++++++++++++++----------------- pages/api/pleasure-real.php | 23 ++++++++++++++++++----- pages/api/pleasure.php | 23 ++++++++++++++++++----- 4 files changed, 64 insertions(+), 44 deletions(-) (limited to 'pages/api') diff --git a/pages/api/emergency-real.php b/pages/api/emergency-real.php index a67f549..700a6a7 100644 --- a/pages/api/emergency-real.php +++ b/pages/api/emergency-real.php @@ -1,6 +1,7 @@ [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" . - "Priority: urgent\r\n" . - "Tags: emergency\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now!") - ] -])); +if (isset($_GET["raindrops"])) $channels[] = "emergency-raindrops"; +if (isset($_GET["moonglow"])) $channels[] = "emergency-moonglow"; +if (isset($_GET[$GLOBALS["ColdHazeApp"]["other"]["slug"]])) $channels[] = "emergency"; -file_get_contents('https://' . $ntfy["server"] . '/emergency', false, stream_context_create([ +$context = stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" . + "Title: " . formatPonypush("⚠️ Emergency alert") . "\r\n" . "Priority: urgent\r\n" . "Tags: emergency\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now!") + 'content' => formatPonypush("This is an emergency, " . $_PROFILE['name'] . " is in need of immediate help. Please act now!") ] -])); +]); + +foreach ($channels as $channel) { + file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context); +} die(); \ No newline at end of file diff --git a/pages/api/emergency.php b/pages/api/emergency.php index 24c975a..a8a6e20 100644 --- a/pages/api/emergency.php +++ b/pages/api/emergency.php @@ -1,6 +1,7 @@ [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("[Test] ⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" . - "Priority: urgent\r\n" . - "Tags: emergency\r\n" . - "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]") - ] -])); +if (isset($_GET["raindrops"])) $channels[] = "emergency-raindrops"; +if (isset($_GET["moonglow"])) $channels[] = "emergency-moonglow"; +if (isset($_GET[$GLOBALS["ColdHazeApp"]["other"]["slug"]])) $channels[] = "emergency"; -file_get_contents('https://' . $ntfy["server"] . '/emergency', false, stream_context_create([ +$context = stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("[Test] ⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" . + "Title: " . formatPonypush("[Test] ⚠️ Emergency alert") . "\r\n" . "Priority: urgent\r\n" . "Tags: emergency\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]") + 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of immediate help. Please act now! [This notification is test]") ] -])); +]); + +foreach ($channels as $channel) { + file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context); +} die(); \ No newline at end of file diff --git a/pages/api/pleasure-real.php b/pages/api/pleasure-real.php index b523c1a..adfe732 100644 --- a/pages/api/pleasure-real.php +++ b/pages/api/pleasure-real.php @@ -1,6 +1,7 @@ [ 'method' => 'POST', 'header' => @@ -31,8 +40,12 @@ file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_cont "Priority: high\r\n" . "Tags: pleasure\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("Hey, $pony wants to play and have fun for a bit, get up!") + 'content' => formatPonypush("Hey, $pony wants to play and have fun with you, get up!") ] -])); +]); + +foreach ($channels as $channel) { + file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context); +} die(); \ No newline at end of file diff --git a/pages/api/pleasure.php b/pages/api/pleasure.php index 58def71..7d331ce 100644 --- a/pages/api/pleasure.php +++ b/pages/api/pleasure.php @@ -1,6 +1,7 @@ [ 'method' => 'POST', 'header' => @@ -31,8 +40,12 @@ file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_cont "Priority: high\r\n" . "Tags: pleasure\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => formatPonypush("[This is a test] Hey, $pony wants to play and have fun for a bit, get up!") + 'content' => formatPonypush("[This notification is a test] Hey, $pony wants to play and have fun with you, get up! [This notification is a test]") ] -])); +]); + +foreach ($channels as $channel) { + file_get_contents('https://' . $ntfy["server"] . '/' . $channel, false, $context); +} die(); \ No newline at end of file -- cgit