Files
weather/dark-sky.sh

16 lines
468 B
Bash
Executable File

#!/usr/bin/bash
source api-keys.sh
# takes (coords, location_name) as parameters
update-weather-json() {
curl_url="https://api.darksky.net/forecast/$DARK_SKY_KEY/$1?exclude=minutely%2Cdaily%2Calerts%2Cflags&units=auto"
curl --request GET --url $curl_url > $2.json
# echo "curl --request GET --url $curl_url > $2.json"
}
# update-weather-json "43.8180904,-79.3350555" "markham"
# update-weather-json "43.6596426,-79.3976676" "toronto"
node dark-sky.js