Skip to content

Instantly share code, notes, and snippets.

@nikoheikkila
Created March 3, 2018 09:29
Show Gist options
  • Save nikoheikkila/e314f096f5111b21a1d39698faaa2c26 to your computer and use it in GitHub Desktop.
Save nikoheikkila/e314f096f5111b21a1d39698faaa2c26 to your computer and use it in GitHub Desktop.
Weather Tool for Fish Shell using wttr.in API
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