diff --git a/scripts/get_citation.sh b/scripts/get_citation.sh new file mode 100755 index 0000000..5452d62 --- /dev/null +++ b/scripts/get_citation.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# testing getting images dynamically +first_call=$(lynx -dump -listonly "https://commons.wikimedia.org/w/index.php?search=${1//_/+}&title=Special:MediaSearch&go=Go&type=image") +lynx -dump -nonumbers $(lynx -dump \ + $(echo "$first_call" \ + | sed '11q;d' \ + | awk '{print $2}' ) \ + | awk -F'. ' '/Cite/ {print $2}' \ + | xargs echo -n) 2>&1 | grep -A10 'Chicago style' | grep -A10 -e '^$' | grep -B10 'CBE' | grep -B10 -e '^$' diff --git a/scripts/get_image.sh b/scripts/get_image.sh new file mode 100755 index 0000000..132df45 --- /dev/null +++ b/scripts/get_image.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# testing getting images dynamically +first_call=$(lynx -dump -listonly "https://commons.wikimedia.org/w/index.php?search=${1//_/+}&title=Special:MediaSearch&go=Go&type=image") +lynx -dump -listonly \ + $(echo "$first_call" \ + | sed '11q;d' \ + | awk '{print $2}' ) \ + | awk '/thumb/ {print $2}' \ + | head -1 \ + | xargs echo -n diff --git a/scripts/stats.php b/scripts/stats.php index 2f1d405..b03be6d 100644 --- a/scripts/stats.php +++ b/scripts/stats.php @@ -119,6 +119,16 @@ a { text-align: center; } +img { + width:75%; +} + +.center { + display: block; + margin-left: auto; + margin-right: auto; +} + select { font-size:large; width: 60%; @@ -148,7 +158,7 @@ form { float: none; width: 100%; } - input, label { + input, label, img { width:100%; { } @@ -226,19 +236,23 @@ while($rows=$stats ->fetch_assoc()) while($rows = $specificstats->fetch_assoc()) { $dbname = preg_replace('/ /', '_', $rows['Com_Name']); $dbsciname = preg_replace('/ /', '_', $rows['Sci_Name']); + $imagelink = shell_exec("/home/pi/BirdNET-Pi/scripts/get_image.sh $dbname"); + $imagecitation = shell_exec("/home/pi/BirdNET-Pi/scripts/get_citation.sh $dbname"); echo "
";echo $imagecitation;echo "