Skip to content

Instantly share code, notes, and snippets.

@fleeting
Created October 15, 2012 15:56
Show Gist options
  • Save fleeting/3893256 to your computer and use it in GitHub Desktop.
Save fleeting/3893256 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
weather();
setInterval(weather, 15000);
});
function weather() {
$.simpleWeather({
zipcode: '19104',
unit: 'f',
success: function(weather) {
html = '<img style="float:left;" width="210px" src="'+weather.image+'">';
html += '<p>'+weather.temp+'&deg; '+weather.units.temp+'<br /><span>'+weather.currently+'</span></p>';
$("#weather").html(html);
},
error: function(error) {
$("#weather").html('<p>'+error+'</p>');
}
});
}​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment