-
-
Save maxpatternman/45e79e83f50513306255a7caf691727b to your computer and use it in GitHub Desktop.
Weather information with curl and wttr.io
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
#!/usr/bin/env bash | |
# usage: wttr [location], e.g. wttr Berlin, wttr New\ York | |
# Standard location if no parameters were passed | |
location='' | |
language='' | |
# Expand terminal display | |
printf "\e[8;41;125t" | |
if [ -z "$language" ]; then | |
language=${LANG%_*} | |
fi | |
curl \ | |
-H "Accept-Language: ${language}" \ | |
wttr.in/"${1:-${location}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment