Skip to content

A live bird collage card for your Home Assistant dashboard.

Merge branch 'main' into remove-python-shebangs

Patrick McGuirec54c0c7f1741
diff --cc scripts/install_services.sh
index a63febe6,1d038b9c..77e42e53
--- a/scripts/install_services.sh
+++ b/scripts/install_services.sh
@@@ -9,11 -9,9 +9,11 @@@ config_file=$my_dir/birdnet.con
export USER=$USER
export HOME=$HOME
+export PYTHON_VIRTUAL_ENV="$HOME/BirdNET-Pi/birdnet/bin/python3"
+
install_depends() {
apt install -y debian-keyring debian-archive-keyring apt-transport-https
- curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
+ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
apt -qqq update && apt -qqy upgrade
echo "icecast2 icecast2/icecast-setup boolean false" | debconf-set-selections
diff --cc scripts/stats.php
index e1be3b99,3ad11f02..eb9eda03
--- a/scripts/stats.php
+++ b/scripts/stats.php
@@@ -177,13 -169,14 +169,15 @@@ while($results=$result3->fetchArray(SQL
ob_flush();
flush();
if (file_exists('./scripts/thisrun.txt')) {
- $config = parse_ini_file('./scripts/thisrun.txt');
+ $config = parse_ini_file('./scripts/thisrun.txt');
} elseif (file_exists('./scripts/firstrun.ini')) {
- $config = parse_ini_file('./scripts/firstrun.ini');
+ $config = parse_ini_file('./scripts/firstrun.ini');
}
- $flickrjson = json_decode(file_get_contents("https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=".$config["FLICKR_API_KEY"]."&text=\"".str_replace('_', '+', $comname)."\"&license=2%2C3%2C4%2C5%2C6%2C9&sort=relevance&per_page=15&format=json&nojsoncallback=1"), true)["photos"]["photo"];
+ if (! empty($config["FLICKR_API_KEY"])) {
+ $flickrjson = json_decode(file_get_contents("https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=".$config["FLICKR_API_KEY"]."&text=\"".str_replace('_', '+', $comname)."\"&license=2%2C3%2C4%2C5%2C6%2C9&sort=relevance&per_page=15&format=json&nojsoncallback=1"), true)["photos"]["photo"];
+
+ foreach ($flickrjson as $val) {
+
- foreach ($flickrjson as $val) {
$iter++;
$modaltext = "https://flickr.com/photos/".$val["owner"]."/".$val["id"];
$authorlink = "https://flickr.com/people/".$val["owner"];