diff --git a/dark-sky.fish b/dark-sky.fish old mode 100644 new mode 100755 index 011f3a6..19457bb --- a/dark-sky.fish +++ b/dark-sky.fish @@ -1,3 +1,5 @@ +#!/usr/bin/fish + source api-keys-fish.sh # IBM set curl_url "https://api.darksky.net/forecast/$DARK_SKY_KEY/43.8180904,-79.3350555?exclude=minutely%2Cdaily%2Calerts%2Cflags&units=auto" diff --git a/dark-sky.js b/dark-sky.js index 4ebe2a6..c564ee2 100644 --- a/dark-sky.js +++ b/dark-sky.js @@ -1,6 +1,6 @@ const log = console.log const fs = require('fs') -const {table} = require('table') +const {table, getBorderCharacters} = require('table') const HOURS_AHEAD = 12 @@ -30,7 +30,8 @@ jsonReader('./dark-sky.json', (err, weatherInfo) => { 0: { alignment: 'center' }, 1: { alignment: 'center' }, 2: { alignment: 'center' }, - } + }, + border: getBorderCharacters(`ramac`) } const infoList = [['H', '°C', '%P']] for (let i = 0; i < HOURS_AHEAD; i++) { diff --git a/dark-sky.service b/dark-sky.service new file mode 100644 index 0000000..f2f4bcf --- /dev/null +++ b/dark-sky.service @@ -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 diff --git a/dark-sky.timer b/dark-sky.timer new file mode 100644 index 0000000..1b99f93 --- /dev/null +++ b/dark-sky.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Fetch local weather + +[Timer] +OnCalendar=6,12,18,00:00 +Persistent=true + +[Install] +WantedBy=timers.target