Get weather from zipcode or woeid using yahoo's weather api
Use bower
bower install weather --save
Download the production version or the development version.
<script src="jquery.js"></script>
<script src="dist/weather.min.js"></script>
<script>
jQuery(document).ready(function($) {
weather('02210', function(err, result) {
if (err) {
alert('uh oh: ' + err);
return;
}
alert(result.condition.temp);
});
});
</script>
require(["components/weather/weather"], function(weather) {
weather('02210', function(err, result) {
if (err) {
alert('uh oh: ' + err);
return;
}
alert(result.condition.temp);
});
});
In addition to the yahoo provided information in the returned weather object,
the weather.condition
object has a symbols
array and symbolLevel
string.
The symbols
array is one or more unicode characters to represent the weather.
The symbolLevel
string is either 'light', 'normal', or 'heavy' to represent
the weather symbol severity.
(Coming soon)
(Nothing yet)