Created
March 3, 2018 09:29
-
-
Save nikoheikkila/e314f096f5111b21a1d39698faaa2c26 to your computer and use it in GitHub Desktop.
Weather Tool for Fish Shell using wttr.in API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function weather -d "Prints weather information for the given location" | |
if set -q $argv[1] | |
set location $argv[1] | |
else | |
set location "Jyväskylä" | |
end | |
# Parse language information from current locale | |
set -l language (string split "_" -- $LANG)[1] | |
curl -H "Accept-Language: $language" wttr.in/"$argv[1]?0&n&q" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment