-
Notifications
You must be signed in to change notification settings - Fork 0
/
weather_now
executable file
·45 lines (33 loc) · 1.04 KB
/
weather_now
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
#php darksky.php
curTime=$(jq '.currently.time' dkSky.json)
curTemp=$(jq '.currently.temperature' dkSky.json)
# get today's high from the "daily" object
tempMax=$(jq '.daily.data[0].temperatureMax' dkSky.json)
windMPH=$(jq '.currently.windSpeed' dkSky.json)
windFrom=$(jq '.currently.windBearing' dkSky.json)
# for now we just want the summary from the minutely object
minSum=$(jq -r '.minutely.summary' dkSky.json)
#tempMin=$(jq '.currently.temperatureMin' dkSky.json)
#sunDown=$(jq '.currently.sunsetTime' dkSky.json)
#sunUp=$(jq '.currently.sunriseTime' dkSky.json)
#date "+%Y-%m-%d %H:%M:%S" --date=@$curTime
printf '<div class="now">'
date "+%A %B %e %Y %r" --date=@$curTime
printf '<br>'
printf 'Current temp: %.0f ℃ ' $curTemp
printf '<br>'
jq -r '.currently.summary' dkSky.json
printf '<br>'
printf 'High today: %.0f\n ℃ ' $tempMax
printf '<br>'
printf 'Wind %.0f' $windMPH
printf ' mph'
printf ' from '
printf $windFrom
printf '°\n'
source ./wind
printf "$minSum"
printf '</div>'
source ./alerts
source ./hours