Skip to content

Instantly share code, notes, and snippets.

@codewithtyler
Created January 25, 2016 03:39
Show Gist options
  • Save codewithtyler/67fdd9475f5844739001 to your computer and use it in GitHub Desktop.
Save codewithtyler/67fdd9475f5844739001 to your computer and use it in GitHub Desktop.
How can I use weather.js?
Weather.getCurrent("Kansas City", function(current) {
console.log(
["currently:",current.temperature(),"and",current.conditions()].join(" ")
);
});
Weather.getForecast("Kansas City", function(forecast) {
console.log("Forecast High in Kelvin: " + forecast.high());
console.log("Forecast High in Fahrenheit" + Weather.kelvinToFahrenheit( forecast.high() );
console.log("Forecast High in Celsius" + Weather.kelvinToCelsius( forecast.high() );
console.log("Forecast Low in Kelvin: " + forecast.low());
console.log("Forecast Low in Fahrenheit" + Weather.kelvinToFahrenheit( forecast.low() );
console.log("Forecast Low in Celsius" + Weather.kelvinToCelsius( forecast.low() );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment