Skip to content

Instantly share code, notes, and snippets.

@xZero707
Last active May 17, 2022 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xZero707/4ebe0768299d9c8cb26580e48d2081d7 to your computer and use it in GitHub Desktop.
Save xZero707/4ebe0768299d9c8cb26580e48d2081d7 to your computer and use it in GitHub Desktop.
Convenient https://wttr.in wrapper
#!/usr/bin/env sh
set -e
LOCATION="$(echo ${1:-} | sed -e 's/ /%20/g')"
curl --get "https://wttr.in/${LOCATION}"
exit $?
@xZero707
Copy link
Author

xZero707 commented May 17, 2022

  • Save as ${HOME}/bin/wttrin
  • Fix executable permissions chmod a+rx ${HOME}/bin/wttrin
  • Make sure that ${HOME}/bin/ is in ${PATH}.

Usage:

wttrin "New York"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment