Author Topic: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script  (Read 8979 times)

0 Members and 1 Guest are viewing this topic.

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2429
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #75 on: November 27, 2020, 08:47:49 PM »
It doesn't work for me in debug mode.  What did I do wrong?

https://stillwaterweather.com/wx/noaarec.php?noaabug

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #76 on: November 27, 2020, 09:23:32 PM »
You didn't ....

If you view-source you'll see in the comments
Code: [Select]
<!-- RING NOAA -->
<!-- NOAA data FAIL -->
... and your last cache file is too old to be of any use.

Seems they are still all over the place ATM  :roll:
« Last Edit: November 27, 2020, 09:25:12 PM by the beteljuice »
Imagine what you will KNOW tomorrow !

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2429
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #77 on: December 25, 2020, 01:08:28 AM »
Sorry, but I still don't understand what I did or didn't do:

https://stillwaterweather.com/wx/noaarec.php?noaabug

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #78 on: December 25, 2020, 07:44:13 AM »
Same reply as I gave before Bunty - you aren't doing anything 'wrong' - It's them having problems with their servers and either redirecting to a different source (in various formats) or returning nothing !

Read the line at the bottom ....
https://w2.weather.gov/climate/getclimate.php?pil=CLI&recent=yes&wfo=oun&sid=OKC

Imagine what you will KNOW tomorrow !

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #79 on: August 27, 2021, 06:20:16 PM »
IMPORTANT UPDATE v4.0 27 Aug 2021

It seems that the urls have permanently changed and a few other little things  #-o

Many thanks to his worship Ken True for finding the answers and modifying the code.  \:D/

Script available from link in first post.
Imagine what you will KNOW tomorrow !

Offline K3JAE

  • Contributor
  • ***
  • Posts: 137
  • Davis VP2 Wireless
    • K3JAE's Weather Station
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #80 on: December 09, 2021, 04:15:01 PM »
OK, I updated the script to 4.0.

Data being received - somewhat. Running DEBUG displays all items as intended.

URL to data: https://forecast.weather.gov/product.php?site=meg&issuedby=mkl&product=CLI&format=txt&version=1&glossary=0

Results in (only posting area of interest):
THE JACKSON CLIMATE NORMALS FOR TODAY
                                             NORMAL    RECORD    YEAR
 MAXIMUM TEMPERATURE (F)    53              75        2007
 MINIMUM TEMPERATURE (F)     33                9       1995

The Average High/Lows are printing to the page perfectly fine... however the MAX/MIN RECORD with year is not.

Actual page code:
Code: [Select]
<tr>
                    <td align="center" valign="top" style="background-color: #C2F7B9; font-size:8pt; text-align: center; border: 1px solid red; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; padding:2px;">
<span style="font-size:8pt"><?php langtrans('Date Record High<span style="font-weight: bold; color: red">*</span>'); ?></span><br />
<span style="font-size: 12pt; font-weight:bold"><?php echo strip_units($thisDayMax) . $uomTemp?></span><br/>
<span style="font-size:8pt"><?php echo $thisDayMaxYear?></span>
                    </td>
                    <td align="center" valign="top" style="background-color: #C2F7B9; font-size:8pt; text-align: center; border: 1px solid blue; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; padding:2px;">
<span style="font-size:8pt"><?php langtrans('Date Record Low<span style="font-weight: bold; color: red">*</span>'); ?></span><br />
<span style="font-size: 12pt; font-weight:bold"><?php echo strip_units($thisDayMin) . $uomTemp?></span><br/>
<span style="font-size:8pt"><?php echo $thisDayMinYear?></span>
                    </td>
</tr>

I even went as far as commenting out my original code (as it is above) and copy/pasting the code from the DEBUG section of noaarec.php and dropped it in it's place - exact same result.

Guidance please?


**** UPDATE *****
Problem was resolved. I had commented out the include_once('noaarec.php');  in my dashboard page and forgot to re-enable it.  ](*,)  #-o  :roll:
« Last Edit: December 09, 2021, 04:52:45 PM by K3JAE »


73's de K3JAE

John
K3JAE Weather Station

 

anything