OpenFrameworks Weather-Data addon.
Create an API-Key at OpenWeatherMap
or weather.setHasLocalFile(true)
loads for example: bin/data/openweathermap.json
void ofApp::setup(){
weather.setApiKey(apiKey);
weather.setCityAndCountryCode(cityAndCountryCode);
weather.parseData(weather.loadData());
}
void ofApp::update(){
currentTemperature = weather.getCurrentTemperature();
currentHumidity = weather.getCurrentHumidity();
currentWindSpeed = weather.getCurrentWindSpeed();
currentWindDirection = weather.getCurrentWindDirection();
currentClouds = weather.getCurrentClouds();
currentRain = weather.getPrecipitation();
currentAvg = weather.getAverageTemperature();
currentTempTrend = weather.getTemperatureTrend();
currentAvgRain = weather.getAveragePrecipitation();
}
// temperature in Celsius use "metric" (default)
// in Fahrenheit use "imperial", in Kelvin "standard"
weather.setUnits("standard");
MIT License
Just drop the folder into the openFrameworks/addons/
folder.
No Dependencies.
Tested with OF 0.11.2
- additional units: - standard, metric, and imperial support
- rain/snow
- humidity
- local file support
- add default icons mapping
- add more providers/integrations
- humidity
- local file support (example loads a cached json)
- inital release