Skip to content

Instantly share code, notes, and snippets.

@fleeting
Created October 30, 2012 20:15
Show Gist options
  • Save fleeting/3982707 to your computer and use it in GitHub Desktop.
Save fleeting/3982707 to your computer and use it in GitHub Desktop.
Sample usage for the simpleWeather plugin. http://simpleweather.monkeecreate.com
$.simpleWeather({
zipcode: '',
woeid: '2357536',
location: '',
unit: 'f',
success: function(weather) {
html = '<h2>'+weather.city+', '+weather.region+'</h2>';
html += '<img style="float:left;" width="125px" src="'+weather.image+'">';
html += '<p>'+weather.temp+'&deg; '+weather.units.temp+'<br /><span>'+weather.currently+'</span></p>';
html += '<a href="'+weather.link+'">View Forecast &raquo;</a>';
$("#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