Fetch local weather from Dark Sky API. https://wthr.ml/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
513 B

  1. #!/usr/bin/fish
  2. source api-keys-fish.sh
  3. # takes (coords, location_name) as parameters
  4. function update-weather-json
  5. set curl_url "https://api.darksky.net/forecast/$DARK_SKY_KEY/$argv[1]?exclude=minutely%2Cdaily%2Calerts%2Cflags&units=auto"
  6. curl --request GET --url $curl_url > $argv[2].json
  7. # echo "curl --request GET --url $curl_url > $argv[2].json"
  8. end
  9. update-weather-json "43.8180904,-79.3350555" "markham"
  10. update-weather-json "43.6596426,-79.3976676" "toronto"
  11. node dark-sky.js > dark-sky.txt