ForecastCFML is a wrapper for the Forecast.io v2 api (Dark Sky legacy). Forecast.io claims to be "The easiest, most advanced, weather API on the web".
Forecast.io (Dark Sky) v2 is discontinued for new signups. Existing keys may still work, but the service is legacy. The original developer site https://developer.forecast.io/ is no longer available; keep a local copy of the API docs if you need it.
You need an account with Forecast.io.
In the config.cfc, replace YOUR_APIKEY_GOES_HERE with your valid api key along with your latitude and longitude
You may find your citys' coordinates by going to LatLong.net.
To use, call the getWeather() function which takes four arguments:
- baseURL (required, which is https://api.forecast.io/forecast)
- apiKey (required)
- latitude (required)
- longitude (required)
In Components/weather.cfc, make sure the config variable instantiates ForecastCFML.Components.config (not the weather component), or config.getSecrets() will fail.
After plugging in with your parameters, code will generate this.
1.0 Written by DannyD
2.0 Written by damiththa
Apache
Tested against Railo 4. Should work with ColdFusion (might have to import the https cert for https://api.forecast.io/forecast).