Returns the weather forecast using a callback.
Data gathered in WeatherData:
import std.stdio : stdout, stderr; import weather_forecast : getForecast, WeatherData; getForecast(delegate(WeatherData weather_data, Exception err) { if (err) { stderr.writefln("%s", err); } else { stdout.writefln("latitude: %s", weather_data.latitude); stdout.writefln("longitude: %s", weather_data.longitude); stdout.writefln("city: %s", weather_data.city); stdout.writefln("region: %s", weather_data.region); stdout.writefln("country: %s", weather_data.country); stdout.writefln("postal: %s", weather_data.postal); stdout.writefln("temperature: %s", weather_data.temperature); stdout.writefln("summary: %s", weather_data.summary); } });
2.0.0
Boost Software License - Version 1.0
Get weather forecast with the D programming language. It first gets your longitude and latitude using http://ipinfo.io. Then uses them to look up your weather using http://forecast.weather.gov.
Home page: https://github.com/workhorsy/d-weather-forecast