Skip to content

Instantly share code, notes, and snippets.

@sethwalker
Created December 16, 2010 02:41
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 sethwalker/742948 to your computer and use it in GitHub Desktop.
Save sethwalker/742948 to your computer and use it in GitHub Desktop.
#!/bin/bash
curl "http://umbrellatoday.com/forecasts" --data-ascii "<forecast><location-name>`echo $1`</location-name></forecast>" -H "Accept: text/xml" -H "Content-Type: text/xml" -i 2>/dev/null | awk '/^Location:/ { print $2 }' | xargs curl -H "Accept: text/xml" 2>/dev/null | perl -ne '/<answer>(\w+)<\/answer>/ && print uc("$1\n")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment