Created
April 29, 2015 22:13
-
-
Save DrewDouglass/bedeaa2a6e1bc569619c to your computer and use it in GitHub Desktop.
Get the weather in your shell
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
weather() { | |
echo Your Location: | |
curl -s "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-YOURZIPCODE}" | perl -ne 's/&deg;/°/g;/<title>([^<]+)/&&printf "%s: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment