Created
March 13, 2014 06:33
-
-
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.
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
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