mirror of
https://github.com/fenix-soft/fmeteo.git
synced 2025-01-03 09:39:14 +01:00
version 1.3
This commit is contained in:
parent
f6a73fad36
commit
a24690b8e2
@ -1,3 +1,7 @@
|
||||
# V1.3
|
||||
- now fmeteo convert wind degreese on cardinal notation (N..E.. N-NE..ecc) called "wind dir"
|
||||
- add deg2card tools script, look the readme on the tools folder for more info
|
||||
|
||||
# V1.2
|
||||
- add curl silent mode (now the output video is more clear)
|
||||
- fix some code
|
||||
|
47
fmeteo
47
fmeteo
@ -4,7 +4,7 @@
|
||||
####################################################################################
|
||||
# script meteo che usa oopenweathermap per i dati e li riporta a terminale
|
||||
#
|
||||
# v:1.2
|
||||
# v:1.3
|
||||
#
|
||||
# dipendenze: curl,jq,cat,bc
|
||||
#
|
||||
@ -83,10 +83,53 @@ S=`cat meteonow.txt | jq -r '.list[0]|.snow'`
|
||||
Ws=`cat meteonow.txt | jq -r '.list[0]|.wind.speed'`
|
||||
Wsd=`cat meteonow.txt | jq -r '.list[0]|.wind.deg'`
|
||||
|
||||
|
||||
# convert m/s to Km/s
|
||||
WsKM=$(echo "3.6"*$Ws | bc)
|
||||
|
||||
|
||||
# convert degreese to cardinal name
|
||||
|
||||
if (($(echo "$Wsd>= 0" | bc))); then W_nc="N"; fi
|
||||
|
||||
if (($(echo "$Wsd>= 22.5" | bc))); then W_nc="N-NE"; fi
|
||||
|
||||
if (($(echo "$Wsd>= 45" | bc))); then W_nc="NE"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 67.5" | bc))); then W_nc="E-NE"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 90" | bc))); then W_nc="E"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 112.5" | bc))); then W_nc="E-SE"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 135" | bc))); then W_nc="SE"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 157.5" | bc))); then W_nc="S-SE"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 180" | bc))); then W_nc="S"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 202.5" | bc))); then W_nc="S-SW"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 225" | bc))); then W_nc="SW"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 247.5" | bc))); then W_nc="W-SW"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 270" | bc))); then W_nc="W"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 292.5" | bc))); then W_nc="W-NW"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 315" | bc))); then W_nc="NW"; fi;
|
||||
|
||||
if (($(echo "$Wsd>= 337.5" | bc))); then W_nc="N-NW"; fi;
|
||||
|
||||
if (($(echo "$Wsd== 360" | bc))); then W_nc="N"; fi;
|
||||
|
||||
if (($(echo "$Wsd> 360" | bc))); then W_nc="-?-"; fi;
|
||||
|
||||
if (($(echo "$Wsd< 0" | bc))); then W_nc="-?-"; fi
|
||||
|
||||
|
||||
|
||||
# print to video all data..
|
||||
echo " "
|
||||
echo " " $city_name","$L " " "Lat: "$Lat " " "Lon: "$Lon " " "id:" $city_id
|
||||
@ -98,6 +141,6 @@ echo " " "Temp (C°): "$T " " "Tmax (C°): "$Tmax" " "Tmin (C°): "$Tmin " " "
|
||||
echo " "
|
||||
echo " " "Pressure (hPa): "$PrS " " "Clouds (%): "$ClD " " "Rain (mm): "$R " " "Snow (mm): "$S
|
||||
echo " "
|
||||
echo " " "Wind speed (km/h): "$WsKM " " "Wind deg (°): "$Wsd
|
||||
echo " " "Wind speed (km/h): "$WsKM " " "Wind deg (°): "$Wsd " " "Wind dir: "$W_nc
|
||||
echo " "
|
||||
echo " "
|
||||
|
@ -1 +1 @@
|
||||
1.2
|
||||
1.3
|
Loading…
Reference in New Issue
Block a user