Is it Raining?

It’s Fall in the Northwest and the rain is here. I want to query the Open Weather API and see if it is raining outside since I have no windows at work and this will be my window to the outside.

function getTemp() {
    $.getJSON("http://api.openweathermap.org/data/2.5/weather?q=seattle,usa&units=imperial&APPID=YOURAPPID", function(data) {
		var weather= data.weather,
		rain =  weather[0].main;
		weather_description =  weather[0].description;
		if(rain =='Rain'){
			rain = 'Yes';
		}else{
			rain = 'No, but it\'s ' + weather_description;
		}
		$('#rain').html(rain);
    });
    setTimeout("getTemp()",600000);
}

Is it Raining?

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.