Skip to content

Instantly share code, notes, and snippets.

@DrewDouglass
Created April 29, 2015 22:13
Show Gist options
  • Save DrewDouglass/bedeaa2a6e1bc569619c to your computer and use it in GitHub Desktop.
Save DrewDouglass/bedeaa2a6e1bc569619c to your computer and use it in GitHub Desktop.
Get the weather in your shell
weather() {
echo Your Location:
curl -s "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-YOURZIPCODE}" | perl -ne 's/&amp;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