X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2Fweather%2FGetWeatherForecastFunction.java;h=970d022f67032ce0e45cc9ffce7e5921abb77486;hp=7b6f8c7602dcce9ea88b0e44699876b262b32eb6;hb=88f2c3647ed9e055090484f01a959d4581f85e7d;hpb=326f489e36aa7f235bc19409a57bf4955cd50f24 diff --git a/tim/prune/function/weather/GetWeatherForecastFunction.java b/tim/prune/function/weather/GetWeatherForecastFunction.java index 7b6f8c7..970d022 100644 --- a/tim/prune/function/weather/GetWeatherForecastFunction.java +++ b/tim/prune/function/weather/GetWeatherForecastFunction.java @@ -73,6 +73,8 @@ public class GetWeatherForecastFunction extends GenericFunction implements Runna /** True to just simulate the calls and read files instead, false to call real API */ private static final boolean SIMULATE_WITH_FILES = false; + /** Unique API key for GpsPrune */ + private static final String OPENWEATHERMAP_API_KEY = "d1c5d792362f5a5c2eacf70a3b72ecd6"; /** @@ -365,7 +367,8 @@ public class GetWeatherForecastFunction extends GenericFunction implements Runna + (_locationId == null ? ("lat=" + NumberUtils.formatNumberUk(lat, 5) + "&lon=" + NumberUtils.formatNumberUk(lon, 5)) : ("id=" + _locationId)) + "&lang=" + I18nManager.getText("openweathermap.lang") - + "&mode=xml&units=" + (inUseCelsius ? "metric" : "imperial"); + + "&mode=xml&units=" + (inUseCelsius ? "metric" : "imperial") + + "&APPID=" + OPENWEATHERMAP_API_KEY; // System.out.println(urlString); // Parse the returned XML with a special handler @@ -431,7 +434,8 @@ public class GetWeatherForecastFunction extends GenericFunction implements Runna final String forecastCount = inDaily ? "8" : "3"; final String urlString = "http://api.openweathermap.org/data/2.5/forecast" + (inDaily ? "/daily" : "") + "?id=" + _locationId + "&lang=" + I18nManager.getText("openweathermap.lang") - + "&mode=xml&units=" + (inCelsius ? "metric" : "imperial") + "&cnt=" + forecastCount; + + "&mode=xml&units=" + (inCelsius ? "metric" : "imperial") + "&cnt=" + forecastCount + + "&APPID=" + OPENWEATHERMAP_API_KEY; // System.out.println(urlString); // Parse the returned XML with a special handler