Author Topic: buoy-data.php V1.19 released .. use curl/https for www.ndbc.noaa.gov data  (Read 524 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6740
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Looks like www.ndbc.noaa.gov switched to mandatory https access, and the V1.18 script was http-only.

The V1.19 script now uses curl for the access via https and has a couple of minor fixes for PHP7+

Download from the script page

Thanks to Bob from http://www.ka5zci.com/ for the heads-up!

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 3135
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Thanks, Ken. The revised script seems to be working well.

Greg H.
« Last Edit: June 27, 2018, 04:39:42 PM by miraculon »


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline Toxic

  • Senior Contributor
  • ****
  • Posts: 250
  • #conligwx
    • conligwx.org
Cheers Ken!

Sent from my ONEPLUS A6003 using Tapatalk


Offline satcop

  • Senior Contributor
  • ****
  • Posts: 210
    • Clifton Virginia Weather
Thanks Ken , looks like the agencies are finally switching over.  Working here.
Clifton, Virginia Weather


Blitzortung Stations 1189, 1451 - CWOP EW1675

Offline Toxic

  • Senior Contributor
  • ****
  • Posts: 250
  • #conligwx
    • conligwx.org
Ken

I posted over at Cumulus forums too about this.

Ken

I have just checked my Apache Error logs and it is full (100's) of these type of entries:

Code: [Select]
[Wed Jun 27 21:51:41.568967 2018] [php7:notice] [pid 30454:tid 140246979712768] [client x.x.x.x:50472] PHP Notice:  Undefined offset: 0 in /share/htdocs/weather/buoy-data.php on line 355
[Wed Jun 27 21:52:42.635538 2018] [php7:notice] [pid 28803:tid 140670040332032] [client x.x.x.x:50542] PHP Notice:  Undefined offset: 1 in /share/htdocs/weather/buoy-data.php on line 1119
[Wed Jun 27 21:52:42.635599 2018] [php7:notice] [pid 28803:tid 140670040332032] [client x.x.x.x:50542] PHP Notice:  Undefined offset: 2 in /share/htdocs/weather/buoy-data.php on line 1119
[Wed Jun 27 21:52:42.635623 2018] [php7:notice] [pid 28803:tid 140670040332032] [client x.x.x.x:50542] PHP Notice:  Undefined offset: 3 in /share/htdocs/weather/buoy-data.php on line 1119

is this an error or just a warning that can be ignored?

also line 861

Code: [Select]
global $seenBuoy,$Buoys,$Units,$NDBCURL,$myUOM,$table,$scroller,$CSS,$skipNoData,$windArrowDir,$showNoData,$windArrowSize;
;

2 semi-colons one after another, is that correct?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6740
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Ken

I posted over at Cumulus forums too about this.

Ken

I have just checked my Apache Error logs and it is full (100's) of these type of entries:

Code: [Select]
[Wed Jun 27 21:51:41.568967 2018] [php7:notice] [pid 30454:tid 140246979712768] [client x.x.x.x:50472] PHP Notice:  Undefined offset: 0 in /share/htdocs/weather/buoy-data.php on line 355
[Wed Jun 27 21:52:42.635538 2018] [php7:notice] [pid 28803:tid 140670040332032] [client x.x.x.x:50542] PHP Notice:  Undefined offset: 1 in /share/htdocs/weather/buoy-data.php on line 1119
[Wed Jun 27 21:52:42.635599 2018] [php7:notice] [pid 28803:tid 140670040332032] [client x.x.x.x:50542] PHP Notice:  Undefined offset: 2 in /share/htdocs/weather/buoy-data.php on line 1119
[Wed Jun 27 21:52:42.635623 2018] [php7:notice] [pid 28803:tid 140670040332032] [client x.x.x.x:50542] PHP Notice:  Undefined offset: 3 in /share/htdocs/weather/buoy-data.php on line 1119

is this an error or just a warning that can be ignored?
Hmmm... that error is a failure to find the raw buoy data based on
Code: [Select]
preg_match_all('|<p class="red"><strong>(.*)</pre>|si',$html,$betweenspan);
 
 //$Status .= "<!-- betweenspan \n" . print_r($betweenspan,true) . " -->\n";
 
 $buoyrawdata = $betweenspan[1][0]; 
  (the last line is 355)
Can you attach the NDBC-buoydata.txt so I can take a look?

The line 1119 is
Code: [Select]
     list($Left,$Top,$Right,$Bottom) = explode(",",$Coords);
and that's based on parsing the buoy config file.. can you attach your mybuoy-UK.txt (or the buoy config file if differently named)?

Quote
also line 861

Code: [Select]
global $seenBuoy,$Buoys,$Units,$NDBCURL,$myUOM,$table,$scroller,$CSS,$skipNoData,$windArrowDir,$showNoData,$windArrowSize;
;

2 semi-colons one after another, is that correct?
Umm.. no, that's a non-harmful typo.  Just one semi-colon is needed, but a null PHP statement is not harmful in any case any more than whitespace.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Toxic

  • Senior Contributor
  • ****
  • Posts: 250
  • #conligwx
    • conligwx.org
here you go.

btw Apache 2.4.33 and PHP 7.2.7 if that helps.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6740
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Iíll have to work on this tonight .. thanks.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6740
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
I replicated the issue with the Notice errata for line 1119 .. it's caused by an entry in mybuoy-United_Kingdom.txt
Code: [Select]
62001|Gascogne Buoy|| which has no coordinates listed .. either add coordinates to that line, or comment it out like
Code: [Select]
#62001|Gascogne Buoy||
and that will suppress the Notice errata.

I was unable to replicate the line 355 Notice errata using your NDBC-buoydataM.txt file :(
The file did have the string looked for by the preg_match, and so it should have found the data accordingly.
Is this error persistent?

Best regards,
Ken


Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Toxic

  • Senior Contributor
  • ****
  • Posts: 250
  • #conligwx
    • conligwx.org
Thanks for the fault finding Ken. the 355 error only appeared as a result of the updated files along with the 1119 line too. I had not touched the mybuoy-United_Kingdom.txt in a few years.

Anyway all sorted now. will try getting back to a new uk map as the old one has quite a few obsolete buoys and oil/gas platforms.

ndbc has listed the uk buoys here https://www.ndbc.noaa.gov/mobile/region.php?reg=united_kingdom  for anyone needing an upto date list.