diff --git a/tools/rf5 b/tools/rf5 index e65a262..15616a1 100644 --- a/tools/rf5 +++ b/tools/rf5 @@ -1,35 +1,39 @@ #!/bin/bash # read and print video forecast 5 data -# V.1.0 +# V.1.1 forecast5() { +echo " " +echo "┌---------------------------------------------------------------┐" +echo "┊ OFFLINE FORECAST WEATHER 5 DAY DATA ┊" +echo "└---------------------------------------------------------------┘" for ((i=0; i<6; i++)); do # exstract forecast 5 data to jason file -city_name=`cat meteonow.txt | jq -r '.list[0]|.name'` -L=`cat meteonow.txt | jq -r '.list[0]|.sys[]'` -Lat=`cat meteonow.txt | jq -r '.list[0]|.coord.lat'` -Lon=`cat meteonow.txt | jq -r '.list[0]|.coord.lon'` -data_X=`cat meteo5.txt | jq -r '.list['$i']|.dt'` +city_name=`cat meteonow.json | jq -r '.list[0]|.name'` +L=`cat meteonow.json | jq -r '.list[0]|.sys[]'` +Lat=`cat meteonow.json | jq -r '.list[0]|.coord.lat'` +Lon=`cat meteonow.json | jq -r '.list[0]|.coord.lon'` +data_X=`cat meteo5.json | jq -r '.list['$i']|.dt'` data_U=`date -d @$data_X` -Wcond_n=`cat meteo5.txt | jq -r '.list['$i']|.weather[].main'` -Wcond_nd=`cat meteo5.txt | jq -r '.list['$i']|.weather[].description'` -Tmax=`cat meteo5.txt | jq -r '.list['$i']|.temp.max'` -Tmin=`cat meteo5.txt | jq -r '.list['$i']|.temp.min'` -TM=`cat meteo5.txt | jq -r '.list['$i']|.temp.morn'` -TE=`cat meteo5.txt | jq -r '.list['$i']|.temp.eve'` -TN=`cat meteo5.txt | jq -r '.list['$i']|.temp.night'` -TD=`cat meteo5.txt | jq -r '.list['$i']|.temp.day'` -Hm=`cat meteo5.txt | jq -r '.list['$i']|.humidity'` -PrS=`cat meteo5.txt | jq -r '.list['$i']|.pressure'` -#ClD=`cat meteo5.txt | jq -r '.list['$i']|.clouds'` -R=`cat meteo5.txt | jq -r '.list['$i']|.rain'` -S=`cat meteo5.txt | jq -r '.list['$i']|.snow'` -Ws=`cat meteo5.txt | jq -r '.list['$i']|.speed'` -Wsd=`cat meteo5.txt | jq -r '.list['$i']|.deg'` +Wcond_n=`cat meteo5.json | jq -r '.list['$i']|.weather[].main'` +Wcond_nd=`cat meteo5.json | jq -r '.list['$i']|.weather[].description'` +Tmax=`cat meteo5.json | jq -r '.list['$i']|.temp.max'` +Tmin=`cat meteo5.json | jq -r '.list['$i']|.temp.min'` +TM=`cat meteo5.json | jq -r '.list['$i']|.temp.morn'` +TE=`cat meteo5.json | jq -r '.list['$i']|.temp.eve'` +TN=`cat meteo5.json | jq -r '.list['$i']|.temp.night'` +TD=`cat meteo5.json | jq -r '.list['$i']|.temp.day'` +Hm=`cat meteo5.json | jq -r '.list['$i']|.humidity'` +PrS=`cat meteo5.json | jq -r '.list['$i']|.pressure'` +#ClD=`cat meteo5.json | jq -r '.list['$i']|.clouds'` +R=`cat meteo5.json | jq -r '.list['$i']|.rain'` +S=`cat meteo5.json | jq -r '.list['$i']|.snow'` +Ws=`cat meteo5.json | jq -r '.list['$i']|.speed'` +Wsd=`cat meteo5.json | jq -r '.list['$i']|.deg'` # convert m/s to Km/s WsKM=$(echo "3.6"*$Ws | bc) diff --git a/tools/rf5_README.md b/tools/rf5_README.md index 32d4a2d..6bf39a7 100644 --- a/tools/rf5_README.md +++ b/tools/rf5_README.md @@ -1,10 +1,18 @@ # rf5: -**rf5**: read and print on video the forecast 5 **jason data** (meteo5.txt) generated to fmeteo. +**rf5**: read and print on video the forecast 5 **jason data** (meteo5.json) generated to fmeteo. The script is a utility to test a future implementation on fmeteo, or read the **old** forecast 5 data, offline. # use: -For use this, put or copy the script, in the same directory of fmeteo and run it. \ No newline at end of file +For use this, put or copy the script, in the same directory of fmeteo and run it. + + rf5 + +or if we are a terminal that does not support xserver we can use a pager to display the data page by page: + + rf5 | less + +use space or the arrow to go forward or back, "q" to exit \ No newline at end of file diff --git a/tools/rf5_cangelog.md b/tools/rf5_cangelog.md index 6b288a4..63c1319 100644 --- a/tools/rf5_cangelog.md +++ b/tools/rf5_cangelog.md @@ -1,3 +1,7 @@ +# V.1.1 +- fix data for fmeteo V1.5 change +- add fmeteo print style + # V.1.0 - initial relase \ No newline at end of file diff --git a/tools/rf5_version.md b/tools/rf5_version.md index 6af9b14..f48927d 100644 --- a/tools/rf5_version.md +++ b/tools/rf5_version.md @@ -1 +1 @@ -V.1.0 \ No newline at end of file +V.1.1 \ No newline at end of file