Skip to content

Instantly share code, notes, and snippets.

@adsahay
Created March 13, 2014 06:33
Show Gist options
  • Save adsahay/9522857 to your computer and use it in GitHub Desktop.
Save adsahay/9522857 to your computer and use it in GitHub Desktop.
Gets weather information using Yahoo Weather feed and parses it to get current conditions. Based on http://code.google.com/p/sh-weather-rss/ but updated to use WOEID than pin code.
curl --silent "http://weather.yahooapis.com/forecastrss?w=20070458&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'
# Note: Use YQL (eg. http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20text%3D%22New%20Delhi%22&format=json) to find WOEID (the w= param in the url).
# More: http://developer.yahoo.com/weather/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment