From 9e5331168c03d87edcad18ec1a48940027bed9ae Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Sat, 7 May 2022 12:33:14 -0400 Subject: [PATCH] apprise starting point --- birdnet.conf-defaults | 10 ---------- requirements.txt | 1 + scripts/config.php | 17 +++++++++++++---- scripts/species_notifier.sh | 4 ++++ scripts/update_birdnet_snippets.sh | 5 +++++ 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/birdnet.conf-defaults b/birdnet.conf-defaults index d1dd7b9..e0e38a2 100644 --- a/birdnet.conf-defaults +++ b/birdnet.conf-defaults @@ -68,16 +68,6 @@ RTSP_STREAM= PUSHED_APP_KEY= PUSHED_APP_SECRET= -#------------------- Browser Notifications via Notify.run -------------------# -#________________The variable below enables browser notifications______________# -#________________________See https://notify.run/ to get________________________# -#_________________ __these subscription URL for your device.___________________# - -# Keep these EMPTY if haven't setup a Notify.run Channel yet. # - -## Notify.run Channel ID - -NOTIFY_RUN_CHANNEL_ID= ################################################################################ #-------------------------------- Defaults ----------------------------------# diff --git a/requirements.txt b/requirements.txt index 9f651b4..22f27e2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ pandas seaborn streamlit plotly +apprise \ No newline at end of file diff --git a/scripts/config.php b/scripts/config.php index cebf813..a71e529 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -9,7 +9,7 @@ $longitude = $_GET["longitude"]; $birdweather_id = $_GET["birdweather_id"]; $pushed_app_key = $_GET["pushed_app_key"]; $pushed_app_secret = $_GET["pushed_app_secret"]; -$notify_run_channel = $_GET["notify_run_channel"]; +$apprise_input = $_GET['apprise_input']; $contents = file_get_contents("/etc/birdnet/birdnet.conf"); $contents = preg_replace("/LATITUDE=.*/", "LATITUDE=$latitude", $contents); @@ -32,6 +32,10 @@ $fh2 = fopen("./scripts/thisrun.txt", "w"); fwrite($fh, $contents); fwrite($fh2, $contents2); +$appriseconfig = fopen("~/.apprise"); +fwrite($appriseconfig, $apprise_input); + + $language = $_GET["language"]; if ($language != "none"){ $user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd"); @@ -57,6 +61,11 @@ if (file_exists('./scripts/thisrun.txt')) { } elseif (file_exists('./scripts/firstrun.ini')) { $config = parse_ini_file('./scripts/firstrun.ini'); } +if (file_exists('~/.apprise')) { + $apprise_config = file_get_contents('~/.apprise'); +} else { + $apprise_config = ""; +} $caddypwd = $config['CADDY_PWD']; if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); @@ -88,9 +97,9 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) {

Pushed iOS Notifications can be setup and enabled for New Species notifications. Be sure to "Enable" the "Pushed Notifications" in "Tools" > "Services" if you would like to use this feature. Sorry, Android users, this only works on iOS.

- -
-

Notify.run browser notifications can be setup and enabled for New Species notifications.

+ + +

Apprise Notifications can be setup and enabled for New Species notifications.