weather_forecast

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

Members

Functions

getForecast
void getForecast(void delegate(WeatherData weather_data, Exception err) cb)

Returns the weather forecast using a callback.

Structs

WeatherData
struct WeatherData

Data gathered in WeatherData:

Examples

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);
	}
});

Meta

Version

2.0.0

License

Boost Software License - Version 1.0