Update service/timer, ASCII border
This commit is contained in:
2
dark-sky.fish
Normal file → Executable file
2
dark-sky.fish
Normal file → Executable file
@@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/fish
|
||||||
|
|
||||||
source api-keys-fish.sh
|
source api-keys-fish.sh
|
||||||
# IBM
|
# IBM
|
||||||
set curl_url "https://api.darksky.net/forecast/$DARK_SKY_KEY/43.8180904,-79.3350555?exclude=minutely%2Cdaily%2Calerts%2Cflags&units=auto"
|
set curl_url "https://api.darksky.net/forecast/$DARK_SKY_KEY/43.8180904,-79.3350555?exclude=minutely%2Cdaily%2Calerts%2Cflags&units=auto"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const log = console.log
|
const log = console.log
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const {table} = require('table')
|
const {table, getBorderCharacters} = require('table')
|
||||||
|
|
||||||
const HOURS_AHEAD = 12
|
const HOURS_AHEAD = 12
|
||||||
|
|
||||||
@@ -30,7 +30,8 @@ jsonReader('./dark-sky.json', (err, weatherInfo) => {
|
|||||||
0: { alignment: 'center' },
|
0: { alignment: 'center' },
|
||||||
1: { alignment: 'center' },
|
1: { alignment: 'center' },
|
||||||
2: { alignment: 'center' },
|
2: { alignment: 'center' },
|
||||||
}
|
},
|
||||||
|
border: getBorderCharacters(`ramac`)
|
||||||
}
|
}
|
||||||
const infoList = [['H', '°C', '%P']]
|
const infoList = [['H', '°C', '%P']]
|
||||||
for (let i = 0; i < HOURS_AHEAD; i++) {
|
for (let i = 0; i < HOURS_AHEAD; i++) {
|
||||||
|
|||||||
14
dark-sky.service
Normal file
14
dark-sky.service
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Fetch local weather
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/home/kevin/weather/dark-sky.fish
|
||||||
|
User=kevin
|
||||||
|
Group=kevin
|
||||||
|
Environment=PATH=/usr/bin:/usr/local/bin
|
||||||
|
Environment=NODE_ENV=production
|
||||||
|
WorkingDirectory=/home/kevin/weather
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
9
dark-sky.timer
Normal file
9
dark-sky.timer
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Fetch local weather
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=6,12,18,00:00
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
Reference in New Issue
Block a user