# HG changeset patch # User Matti Hamalainen # Date 1578489676 -7200 # Node ID b352722e87173345d47942bbcfba93c0b9821fac # Parent b866ab8bd3822e72eecac3e1ef58d0d24e8493e5 fetch_weather: FMI open data no longer requires an API key. Also the data URLs have changed, so fix those as well. diff -r b866ab8bd382 -r b352722e8717 config.fetch_weather.example --- a/config.fetch_weather.example Fri Dec 06 11:34:50 2019 +0200 +++ b/config.fetch_weather.example Wed Jan 08 15:21:16 2020 +0200 @@ -27,11 +27,8 @@ ## ## Enable/disable open data access from FMI -## You will need to obtain an API key, refer to -## https://ilmatieteenlaitos.fi/avoin-data ## -opt_fmi = 0 -fmi_api_key = "" +opt_fmi = 1 ## ## Debug mode, outputs some stuff sometimes maybe diff -r b866ab8bd382 -r b352722e8717 fetch_weather.pl --- a/fetch_weather.pl Fri Dec 06 11:34:50 2019 +0200 +++ b/fetch_weather.pl Wed Jan 08 15:21:16 2020 +0200 @@ -42,7 +42,6 @@ "opt_fmi" => 0, "opt_tiehallinto" => 0, "purge_threshold" => 60, - "fmi_api_key" => "", "outfile" => "", "http_user_agent" => "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 6.0) Opera 10.63 [en]", "tiehallinto_meta" => "tiehallinto.meta", @@ -483,11 +482,11 @@ ### if (opt_chk_bool("opt_fmi")) { - die("FMI data scrape enabled, but no API key set.\n") unless opt_chk_valid("fmi_api_key", 10); my @fmitems = ("temperature", "humidity", "windspeedms", "totalcloudcover"); - my $uri = "http://data.fmi.fi/fmi-apikey/".opt_get("fmi_api_key"). - "/wfs?request=getFeature&storedquery_id=fmi::observations::weather::". + my $uri = "https://opendata.fmi.fi/wfs". + "?request=getFeature". + "&storedquery_id=fmi::observations::weather::". "multipointcoverage". # "timevaluepair". "&starttime=".format_time_gmt(time() - 10*60)."&endtime=".format_time_gmt(time()).