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

0 Members and 1 Guest are viewing this topic.

Offline PSJohn

  • Contributor
  • ***
  • Posts: 140
    • 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: 6989
  • 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, 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: 6989
  • 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, 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 SoMDWx

  • Forecaster
  • *****
  • Posts: 809
    • 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
Jim Wyman
Southern Maryland Weather
http://somdweather.com
http://scit.somdweather.com

Offline PSJohn

  • Contributor
  • ***
  • Posts: 140
    • 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: 809
    • 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
Jim Wyman
Southern Maryland Weather
http://somdweather.com
http://scit.somdweather.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6989
  • 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, 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 jgillett

  • Forecaster
  • *****
  • Posts: 1160
  • unnamed weather station, 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
BUY FROM AMAZON  HERE... Thank You! :-)

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 809
    • 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
Jim Wyman
Southern Maryland Weather
http://somdweather.com
http://scit.somdweather.com

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 531
    • 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>

Davis Vantage Pro2, Serial Data Logger
WD 10.37S-(b60), VWS V15.00p03, Weatherlink 6.0.3,  Fling 2.35, Broadwave 2.0, Win 7 Pro 64Bit
KMICHEBO10 - CW3699 - Cheboygan, MI

Offline lstrip

  • Member
  • *
  • Posts: 24
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: 6989
  • 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, 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 lstrip

  • Member
  • *
  • Posts: 24
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: 6989
  • 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, 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 lstrip

  • Member
  • *
  • Posts: 24
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: 24
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: 6989
  • 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, 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 lstrip

  • Member
  • *
  • Posts: 24
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: 219
  • 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."


 

anything