changeset 486:b352722e8717

fetch_weather: FMI open data no longer requires an API key. Also the data URLs have changed, so fix those as well.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 08 Jan 2020 15:21:16 +0200
parents b866ab8bd382
children b4be881a9908
files config.fetch_weather.example fetch_weather.pl
diffstat 2 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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()).