Author Topic: NWS CPC USA Extremes Script Update...  (Read 3171 times)

0 Members and 1 Guest are viewing this topic.

Offline PSJohn

  • Senior Contributor
  • ****
  • Posts: 157
    • DesertWeather.com
NWS CPC USA Extremes Script Update...
« on: February 06, 2019, 07:23:03 PM »
FYI: the NWS CPC USA Extremes script needs an update.

Out dated URL: $url2 = "http://www.cpc.noaa.gov/products/analysis_monitoring/cdus/prcp_temp_tables/dly_glob1.txt";
NEW URL:        $url2 = "https://www.cpc.ncep.noaa.gov/products/analysis_monitoring/cdus/prcp_temp_tables/dly_glob1.txt";

Just update file or wait until Ken updates it!  :grin: ;)
John Slama
Palm Springs, California
Davis Vantage Pro 2, FARS

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NWS CPC USA Extremes Script Update...
« Reply #1 on: February 06, 2019, 07:38:28 PM »
Ahh.. takes one more step
Code: [Select]
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0); has to be added to the curl_fetch since the cert used on www.cpc.noaa.gov does NOT include that site.  Sigh.

usaextremes.php download from https://saratoga-weather.org/usaextremes.php?sce=view
stateextremes.php download from https://saratoga-weather.org/stateextremes.php?sce=view

Thanks John for the heads-up.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NWS CPC USA Extremes Script Update...
« Reply #2 on: February 07, 2019, 04:33:36 PM »
Download again this afternoon if you're still having issues.  I had to add
Code: [Select]
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
also to bypass the bad cert on www.cpc.noaa.gov.  Some server installations check/some don't (my main server doesn't check, my local XAMPP did).  This allows it to work while they still have a cert that doesn't include the specific site.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1014
    • Southern Maryland Weather
Re: NWS CPC USA Extremes Script Update...
« Reply #3 on: February 08, 2019, 08:19:40 PM »
Still getting N/A for the entries......

Jim

Offline PSJohn

  • Senior Contributor
  • ****
  • Posts: 157
    • DesertWeather.com
Re: NWS CPC USA Extremes Script Update...
« Reply #4 on: February 09, 2019, 02:19:59 AM »
Still getting N/A for the entries......
I had to use this source url: "https://www.cpc.ncep.noaa.gov/products/analysis_monitoring/cdus/prcp_temp_tables/dly_glob1.txt" in order for it to work for me.

Ken's file above uses "https://www.cpc.noaa.gov/products/analysis_monitoring/cdus/prcp_temp_tables/dly_glob1.txt".

Not sure if that's a mistake. Ken?  :-)
John Slama
Palm Springs, California
Davis Vantage Pro 2, FARS

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1014
    • Southern Maryland Weather
Re: NWS CPC USA Extremes Script Update...
« Reply #5 on: February 09, 2019, 08:24:09 AM »
Great catch! That worked for me! Thanks!

Jim

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NWS CPC USA Extremes Script Update...
« Reply #6 on: February 09, 2019, 01:51:42 PM »
 #-o   :oops: D'Oh! 

You're correct.. I'd not noticed that the host had changed from www.cpc.noaa.gov to www.cpc.ncep.noaa.gov.

Corrected now in 4.03e of the scripts.

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

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: NWS CPC USA Extremes Script Update...
« Reply #7 on: February 09, 2019, 02:50:48 PM »
Thanks, Ken!
John
W7JKG

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 1014
    • Southern Maryland Weather
Re: NWS CPC USA Extremes Script Update...
« Reply #8 on: February 09, 2019, 03:14:03 PM »
Yes, Thanks Ken for all that you do and continue to do!   =D>

Jim

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: NWS CPC USA Extremes Script Update...
« Reply #9 on: February 09, 2019, 07:09:17 PM »
Agreed - Thanks Ken for everything you do to support this bunch  =D>

CW3699

Offline lstrip

  • Member
  • *
  • Posts: 30
Re: NWS CPC USA Extremes Script Update...
« Reply #10 on: February 10, 2019, 04:05:50 PM »
Just updated the usaextremes and stateextremes scripts.
Shows cache updating but when i run either script, I get nothing.
https://vancamweather.com/usaextremes.php
File permission is set to 666.
What am I missing?
Thanks
Larry

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NWS CPC USA Extremes Script Update...
« Reply #11 on: February 10, 2019, 09:07:44 PM »
The script is currently returning
Quote
500 Error. Internal Server Error.

Setting the cache file (and the script) to 755 should be enough to have it operate correctly.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline lstrip

  • Member
  • *
  • Posts: 30
Re: NWS CPC USA Extremes Script Update...
« Reply #12 on: February 10, 2019, 09:52:08 PM »
Ken
I have set permissions on both the script and cache file to 755.
Still nothing when I run
https://vancamweather.com/stateextremes.php
or
https://vancamweather.com/usaextremes.php
Thanks
Larry

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NWS CPC USA Extremes Script Update...
« Reply #13 on: February 10, 2019, 10:04:10 PM »
Larry, the scripts do not produce output directly.. just load some PHP variables with the data so you can use PHP print statements to put that data where you'd like to see it.

Running view-source:https://vancamweather.com/stateextremes.php and view-source:https://vancamweather.com/usaextremes.php
shows they are running correctly and setting the PHP variables with data.

You need to do something like
Code: [Select]
<?php
include_once("usaextremes.php");

print 
"<p>USA Extremes for $reportDate</p>\n";
print 
"<p>High Temperature<br/><br/>$usahigh</p>\n";
print 
"<p>Low Temperature<br/><br/>$usalow</p>\n";
print 
"<p>High Precipatation<br/><br/>$usaprecip</p>\n";
print 
"<p><small>Data courtsey of <a href=\"";
print 
"https://www.cpc.ncep.noaa.gov/products/analysis_monitoring/cdus/prcp_temp_tables/";
print 
"\">NWS-CPC</a></small></p>\n";

?>
for the USA version.. similarly for the stateextremes version.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline lstrip

  • Member
  • *
  • Posts: 30
Re: NWS CPC USA Extremes Script Update...
« Reply #14 on: February 10, 2019, 10:30:38 PM »
Ken
Thanks for replying.
I have run the usa and stateextreme scripts for quite awhile.
The data always was displayed on the menubar below the alerts
in a box with small font and color.
Did the updated script change this?
Larry

Offline lstrip

  • Member
  • *
  • Posts: 30
Re: NWS CPC USA Extremes Script Update...
« Reply #15 on: February 10, 2019, 10:37:31 PM »
Ken
This is an example of what I would get when I ran the scripts.
https://somdweather.com/somd_usaextremes.php

Larry

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NWS CPC USA Extremes Script Update...
« Reply #16 on: February 10, 2019, 10:48:19 PM »
The script I distributed has always only returned data in $variables .. never printed anything but HTML comments.
Looks like the somd_usaextremes.php script was using an earlier source.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline lstrip

  • Member
  • *
  • Posts: 30
Re: NWS CPC USA Extremes Script Update...
« Reply #17 on: February 11, 2019, 03:58:22 PM »
Thanks Ken

Offline AZmonsooncats

  • Current weather conditions in North Phoenix, Ariz
  • Senior Contributor
  • ****
  • Posts: 248
  • Me & My Little Sis!!
    • Pepper Ridge North Valley  Weather and Lightning
Re: NWS CPC USA Extremes Script Update...
« Reply #18 on: February 12, 2019, 07:08:46 PM »
As always Ken thanks for the update. Got this script working again now all I have to do is figure out  ](*,) how migrate my weather software to the new computer.

Jeanette
"Some dreams are in the night time, And some seem like yesterday
But leaves turn brown and fade, Ships sail away
You long to say a thousand words…but Seasons Change."



CWOP:CW3794, MesoWest: C3794, Facebook: https://www.facebook.com/PepperRidgeNorthValleyWX/

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: NWS CPC USA Extremes Script Update...
« Reply #19 on: February 26, 2020, 07:20:55 AM »
The USA and State Extremes scripts haven't displayed the latest data since Sunday, February 23rd, Ken.  Breezy's home page displays the same problem, so I'm guessing the NWS has changed something again... :-(
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NWS CPC USA Extremes Script Update...
« Reply #20 on: February 26, 2020, 11:07:58 AM »
My version 4.03e uses

$url2 = "https://www.cpc.ncep.noaa.gov/products/analysis_monitoring/cdus/prcp_temp_tables/dly_glob1.txt";

for data, and both state/USA scripts are working fine.  That was updated in Feb, 2019.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: NWS CPC USA Extremes Script Update...
« Reply #21 on: February 26, 2020, 01:22:00 PM »
Thanks, Ken.  That's the version and $url2 I'm using.  The obviously NWS-related problem has somehow been resolved, because the USA and State Extremes are now both populating correctly.

Appreciate your prompt attention, Ken, to this evanescent glitch.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NWS CPC USA Extremes Script Update...
« Reply #22 on: February 26, 2020, 01:41:01 PM »
Next time it happens, run view-source:http://your.site.com/usaextremes.php?force=1 to force a cache reload and see the results of the fetch process.
It should show what the underlying issue is with fetching the URL.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 519
    • Tyler Texas Weather
Re: NWS CPC USA Extremes Script Update...
« Reply #23 on: March 31, 2020, 06:44:44 PM »
Has anyone else noticed the USA Extremes temperatures haven't been updated since last Wednesday, 3/25/2020?

https://www.cpc.ncep.noaa.gov/products/analysis_monitoring/cdus/prcp_temp_tables/dly_glob1.txt

Looks like the location has changed and is now in csv format

https://www.cpc.ncep.noaa.gov/products/cadb/

Steve
« Last Edit: March 31, 2020, 06:47:26 PM by SteveFitz1 »

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: NWS CPC USA Extremes Script Update...
« Reply #24 on: March 31, 2020, 07:25:07 PM »
I’ve also seen this, but have been otherwise preoccupied...
Regards, Jerry Wilkins
gwwilk@gmail.com