diff --git a/scripts/config.php b/scripts/config.php index 41257e3..25ef7bf 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -99,7 +99,7 @@ if(isset($_GET["latitude"])){ $contents = preg_replace("/LONGITUDE=.*/", "LONGITUDE=$longitude", $contents); $contents = preg_replace("/BIRDWEATHER_ID=.*/", "BIRDWEATHER_ID=$birdweather_id", $contents); $contents = preg_replace("/APPRISE_NOTIFICATION_TITLE=.*/", "APPRISE_NOTIFICATION_TITLE=\"$apprise_notification_title\"", $contents); - $contents = preg_replace("/APPRISE_NOTIFICATION_BODY=.*/", "APPRISE_NOTIFICATION_BODY=\"$apprise_notification_body\"", $contents); + $contents = preg_replace("/APPRISE_NOTIFICATION_BODY=.*/", "APPRISE_NOTIFICATION_BODY='$apprise_notification_body'", $contents); $contents = preg_replace("/APPRISE_NOTIFY_EACH_DETECTION=.*/", "APPRISE_NOTIFY_EACH_DETECTION=$apprise_notify_each_detection", $contents); $contents = preg_replace("/APPRISE_NOTIFY_NEW_SPECIES=.*/", "APPRISE_NOTIFY_NEW_SPECIES=$apprise_notify_new_species", $contents); $contents = preg_replace("/APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=.*/", "APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=$apprise_notify_new_species_each_day", $contents); @@ -112,7 +112,7 @@ if(isset($_GET["latitude"])){ $contents2 = preg_replace("/LONGITUDE=.*/", "LONGITUDE=$longitude", $contents2); $contents2 = preg_replace("/BIRDWEATHER_ID=.*/", "BIRDWEATHER_ID=$birdweather_id", $contents2); $contents2 = preg_replace("/APPRISE_NOTIFICATION_TITLE=.*/", "APPRISE_NOTIFICATION_TITLE=\"$apprise_notification_title\"", $contents2); - $contents2 = preg_replace("/APPRISE_NOTIFICATION_BODY=.*/", "APPRISE_NOTIFICATION_BODY=\"$apprise_notification_body\"", $contents2); + $contents2 = preg_replace("/APPRISE_NOTIFICATION_BODY=.*/", "APPRISE_NOTIFICATION_BODY='$apprise_notification_body'", $contents2); $contents2 = preg_replace("/APPRISE_NOTIFY_EACH_DETECTION=.*/", "APPRISE_NOTIFY_EACH_DETECTION=$apprise_notify_each_detection", $contents2); $contents2 = preg_replace("/APPRISE_NOTIFY_NEW_SPECIES=.*/", "APPRISE_NOTIFY_NEW_SPECIES=$apprise_notify_new_species", $contents2); $contents2 = preg_replace("/APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=.*/", "APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=$apprise_notify_new_species_each_day", $contents2); @@ -157,10 +157,18 @@ if(isset($_GET['sendtest']) && $_GET['sendtest'] == "true") { $result0 = $statement0->execute(); while($todaytable=$result0->fetchArray(SQLITE3_ASSOC)) { - $comname = $todaytable['Com_Name']; - $filename = $todaytable['File_Name']; $sciname = $todaytable['Sci_Name']; - $confidence = $todaytable["Confidence"]; + $comname = $todaytable['Com_Name']; + $confidence = $todaytable['Confidence']; + $filename = $todaytable['File_Name']; + $date = $todaytable['Date']; + $time = $todaytable['Time']; + $week = $todaytable['Week']; + $latitude = $todaytable['Lat']; + $longitude = $todaytable['Lon']; + $cutoff = $todaytable['Cutoff']; + $sens = $todaytable['Sens']; + $overlap = $todaytable['Overlap']; } $title = $_GET['apprise_notification_title']; @@ -172,15 +180,31 @@ if(isset($_GET['sendtest']) && $_GET['sendtest'] == "true") { $filename = "http://birdnetpi.local/"."?filename=".$filename; } - $title = str_replace("\$comname", $comname, $title); $title = str_replace("\$sciname", $sciname, $title); + $title = str_replace("\$comname", $comname, $title); $title = str_replace("\$confidence", $confidence, $title); $title = str_replace("\$listenurl", $filename, $title); + $title = str_replace("\$date", $date, $title); + $title = str_replace("\$time", $time, $title); + $title = str_replace("\$week", $week, $title); + $title = str_replace("\$latitude", $latitude, $title); + $title = str_replace("\$longitude", $longitude, $title); + $title = str_replace("\$cutoff", $cutoff, $title); + $title = str_replace("\$sens", $sens, $title); + $title = str_replace("\$overlap", $overlap, $title); - $body = str_replace("\$comname", $comname, $body); $body = str_replace("\$sciname", $sciname, $body); + $body = str_replace("\$comname", $comname, $body); $body = str_replace("\$confidence", $confidence, $body); $body = str_replace("\$listenurl", $filename, $body); + $body = str_replace("\$date", $date, $body); + $body = str_replace("\$time", $time, $body); + $body = str_replace("\$week", $week, $body); + $body = str_replace("\$latitude", $latitude, $body); + $body = str_replace("\$longitude", $longitude, $body); + $body = str_replace("\$cutoff", $cutoff, $body); + $body = str_replace("\$sens", $sens, $body); + $body = str_replace("\$overlap", $overlap, $body); echo "
".shell_exec($home."/BirdNET-Pi/birdnet/bin/apprise -vv -t '".$title."' -b '".$body."' ".$cf." ")."
"; @@ -280,12 +304,28 @@ https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}
Confidence Score
$listenurl
A link to the detection
+
$date
+
Date
+
$time
+
Time
+
$week
+
Week
+
$latitude
+
Latitude
+
$longitude
+
Longitude
+
$cutoff
+
Minimum Confidence set in "Advanced Settings"
+
$sens
+
Sigmoid Sensitivity set in "Advanced Settings"
+
$overlap
+
Overlap set in "Advanced Settings"

Use the variables defined above to customize your notification title and body.


-
+ ' />
>
>