Bug 212693 - misc/gkrellweather2: GrabWeather - default source URL for decoded METAR data sets has been shut down
Summary: misc/gkrellweather2: GrabWeather - default source URL for decoded METAR data ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Carlos J. Puga Medina
URL:
Keywords: easy, patch, patch-ready
Depends on:
Blocks:
 
Reported: 2016-09-14 18:26 UTC by etteldor
Modified: 2016-09-17 10:36 UTC (History)
2 users (show)

See Also:


Attachments
METAR source URL patch (541 bytes, patch)
2016-09-14 18:26 UTC, etteldor
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description etteldor 2016-09-14 18:26:26 UTC
Created attachment 174788 [details]
METAR source URL patch

Overview:
The GrabWeather script fetches decoded METAR data by default from http://weather.noaa.gov/pub/data/observations/metar/decoded
The METAR service on weather.noaa.gov has been shut down as of August 3rd, 2016 [1], causing GrabWeather to fail, which in turn renders gkrellweather unusable.

Actual Results:
Running GrabWeather <station id> doesn't update ${HOME}/.wmWeatherReports/<station id>.[TXT|dat] any more. Weather data in gkrellweather isn't updated.

Expected Results:
After calling GrabWeather <station id>, the files ${HOME}/.wmWeatherReports/<station id>.[TXT|dat] should be updated with the latest METAR data. gkrellweather should display the latest available weather data based on the fetched file.


Additional Information:
For raw data, NOAA suggests fetching data from tgftp.nws.noaa.gov. The same source also provides decoded data sets under the URL http://tgftp.nws.noaa.gov/data/observations/metar/decoded
The file format of the decoded data didn't change, this URL can be used as a direct replacement for the old one.


[1] http://www.nws.noaa.gov/om/notification/scn16-16wngccb.htm
Comment 1 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-09-14 19:51:17 UTC
Thanks for the patch :)

Waiting for mentor approval.
Comment 2 Dmitry Marakasov freebsd_committer freebsd_triage 2016-09-16 22:26:43 UTC
Approved. Don't forget to bump PORTREVISION :)
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-09-16 23:17:38 UTC
A commit references this bug:

Author: cpm
Date: Fri Sep 16 23:16:47 UTC 2016
New revision: 422284
URL: https://svnweb.freebsd.org/changeset/ports/422284

Log:
  - Fix METAR source URL
  - Bump PORTREVISION

  PR:		212693
  Submitted by:	etteldor@gmail.com
  Reviewed by:	amdmi3 (mentor)
  Approved by:	amdmi3 (mentor)

Changes:
  head/misc/gkrellweather2/Makefile
  head/misc/gkrellweather2/files/patch-GrabWeather
Comment 4 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-09-16 23:18:13 UTC
Committed!

Thanks
Comment 5 etteldor 2016-09-17 05:38:18 UTC
Thanks!

pkg-desc should be updated to. I just noticed that it refers to http://www.nws.noaa.gov/oso/siteloc.shtml, which delivers a 404/not found.
The new URL is http://www.nws.noaa.gov/tg/siteloc.php
Comment 6 etteldor 2016-09-17 05:52:28 UTC
Another URL change. This is for gkrellweather.c
Here's a full replacement for the existing files/patch-gkrellweather.c


# diff -u gkrellweather.c.dist gkrellweather.c
--- gkrellweather.c.orig        2009-01-11 19:15:02.000000000 +0100
+++ gkrellweather.c     2016-09-17 07:43:09.380410455 +0200
@@ -777,7 +777,7 @@
         " switch interval - number of seconds (0 = never)" \
         " between switching display\n")
     };
-    static gchar url[] = "http://www.nws.noaa.gov/tg/siteloc.shtml";
+    static gchar url[] = "http://www.nws.noaa.gov/tg/siteloc.php";
     laptop = gtk_notebook_new();
     gtk_notebook_set_tab_pos(GTK_NOTEBOOK(laptop), GTK_POS_TOP);
     gtk_box_pack_start(GTK_BOX(tab), laptop, TRUE, TRUE, 0);
@@ -986,7 +986,7 @@
     options.windspeed_unit = 1;
     options.pressure_unit = 1;
     strcpy(options.station, DEFAULT_STATION_ID);
-    snprintf(options.command, 512, "/usr/share/gkrellm/GrabWeather %s", options.station);
+    snprintf(options.command, 512, "GrabWeather %s", options.station);
     options.command[511] = 0;
     snprintf(options.filename, 512, "%s/.wmWeatherReports/%s.dat",
              getenv("HOME"), options.station);
@@ -998,6 +998,7 @@
 gkrellm_init_plugin(void)
 {
     #ifdef ENABLE_NLS
+        bindtextdomain(PACKAGE, LOCALEDIR);
         bind_textdomain_codeset(PACKAGE, "UTF-8");
     #endif /* ENABLE_NLS */
     style_id = gkrellm_add_meter_style(&air_mon, STYLE_NAME);
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-09-17 10:35:25 UTC
A commit references this bug:

Author: cpm
Date: Sat Sep 17 10:34:57 UTC 2016
New revision: 422307
URL: https://svnweb.freebsd.org/changeset/ports/422307

Log:
  - Add LICENSE_FILE
  - Update patch due another URL change
  - Regenerate patches with 'make makepatch' (pet portlint)
  - Update pkg-descr
  - Bump PORTREVISION

  PR:		212693
  Submitted by:	etteldor@gmail.com
  Approved by:	amdmi3 (mentor)

Changes:
  head/misc/gkrellweather2/Makefile
  head/misc/gkrellweather2/distinfo
  head/misc/gkrellweather2/files/patch-Makefile
  head/misc/gkrellweather2/files/patch-gkrellweather.c
  head/misc/gkrellweather2/pkg-descr
Comment 8 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-09-17 10:36:51 UTC
Done!