This commit is contained in:
fenix-soft 2018-09-20 18:28:01 +02:00 committed by GitHub
parent 7bb84712a1
commit e4f5fbbcbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 24 deletions

View File

@ -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)

View File

@ -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.
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

View File

@ -1,3 +1,7 @@
# V.1.1
- fix data for fmeteo V1.5 change
- add fmeteo print style
# V.1.0
- initial relase

View File

@ -1 +1 @@
V.1.0
V.1.1