Created
August 9, 2016 00:56
-
-
Save codewithtyler/f35c3b8989b84754aa67e7753a33f96a to your computer and use it in GitHub Desktop.
A few ideas I jotted down of how we could integrate API keys into the weather.js project
This file contains hidden or 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.init({ | |
| key: "12345abcde6789fghij" | |
| }); | |
| 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())); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alright! Sorry for the delay. What about this: