Created
January 25, 2016 03:39
-
-
Save codewithtyler/67fdd9475f5844739001 to your computer and use it in GitHub Desktop.
How can I use weather.js?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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