WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: NWROrg Team on September 13, 2018, 09:21:34 AM

Title: NOAA Weather Radio ORG Saratoga Script
Post by: NWROrg Team on September 13, 2018, 09:21:34 AM
NOAA WEATHER RADIO SARATOGA TEMPLATE and STAND ALONE...
NWROrg became SSL ... Your templates and stand alone aren't working correctly...
You are not be synchronizing with the main NWROrg server databases,...
You will ALSO not be loading on your website...
UNLESS YOU MAKE THE FOLLOWING CHANGES to your scripts,
KEN will be releasing an updated version soon.

Add the "S" to the link in the following lines as shown:

NWR-radios-data.php
Line 4
Code: [Select]
//Purpose: fetch and cache the https://noaaweatherradio.org/java/NWR-radio-data.js file  Line 37
Code: [Select]
  $fileName = "https://noaaweatherradio.org/java/NWR-radios-data.js";
Line 86
Code: [Select]
    $content = str_replace('https:\\/\\/noaaweatherradio.org\\/content\\/thumbnails\\/',$imagesDir,$content);

NWR-radios-inc.php

Line 55  "NatGeo"
Make the URL "https"
Code: [Select]
NatGeo' => array(
       'name' => 'NatGeo',
         'URL' =>'http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}',
Line 165
Code: [Select]
These audio streams are graciously provided by personal weather website owners and others though <a href="https://noaaweatherradio.org/" target="_blank">NOAAWEATHERRADIO.org</a>.</p>
Line 183
Code: [Select]
see <a href="https://noaaweatherradio.org/" target="_blank">noaaweatherradio.org</a> website "How To?" page for details to submit an audio stream.
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: Andy G on September 13, 2018, 11:16:35 AM
Thanks for the support. Mine is working after the changes.
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: rrrick8 on September 13, 2018, 10:02:32 PM
Thanks for the heads up. Hadn't noticed it wasn't working.
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: saratogaWX on September 16, 2018, 02:55:35 PM
I've updated the distribution V2.01 at https://saratoga-weather.org/scripts-wxradio.php for https support to noaaweatherradio.org

Changes to NWR-radios-inc.php and NWR-radios-data.php only.  Thanks to all who contributed to the patches!
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: Jumpin Joe on September 20, 2018, 11:47:36 AM
Ken,

I downloaded and installed the updated scripts and have two issues, one iMac and and one google map.
1. On my iMac...  the Auto Play for the Live Broadcast does not work.  I have to click on "Live Broadcast" to have it play.  Also, the Map that should appear below the "Live Broadcast" area and above the "Coverage Area Map" says "Loading Map" and never loads.
2. When I try to view the "NOAA Radio Map" I get a Google error message " This page can't be load Google Maps correctly.  However, when I "click" OK the maps appears to displaying correctly.  This occurs on all browsers.

Any assistance will be greatly appreciated.

Thanks,
Joe
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: saratogaWX on September 20, 2018, 12:24:29 PM
For some unknown reason, the code on the page
Code: [Select]
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
is not loading from either source, so jQuery is not initialized and so the NWR-radios.js script fails with
Quote
ReferenceError: $ is not defined NWR-radios.js:262:1
using Firefox as the browser.

Using Chrome, the page loads, but autoplay does not happen.

It may be caused by your webserver using HTTP but responding with a "Upgrade: h2" header to request the browser to use HTTP2 (but that requires https).

Re (2) -- if you see the Google map message, it means the wrong JavaScript (the old one) was cached in the browser -- clear the cache and reload.

If you have something in your cPanel that says 'Use HTTP2', Id suggest turning it off until your website is fully https capable.

Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: Jumpin Joe on September 20, 2018, 03:35:42 PM
Thank you. I'm looking into https now.
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: Jumpin Joe on September 20, 2018, 07:58:03 PM
Is there away to tell if the certificate was installed? I should be https capable now.
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: saratogaWX on September 20, 2018, 09:04:03 PM
Yes, it is basically HTTPS capable now.. however, you have links to images that are http:// and need to be https:// to keep the 'lock' icon on.

http://chart.apis.google.com/chart?chs=90x60&chma=0,0,0,0&chd=t:50.8,49.2&cht=p3&chp=1.58&chf=bg,s,65432100&chco=FFD700,000000
http://icons.wunderground.com/data/640x480/mw_rd_anim.gif
http://icons.wunderground.com/data/640x480/mw_vi_anim.gif

on your home page.  You need to go through your site and change the http:// links for images (and any external scripts or CSS) to https:// to keep the entire page contents with a 'lock'.
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: Jumpin Joe on September 20, 2018, 10:26:09 PM
Thank you.  I will do that.
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: Jumpin Joe on September 21, 2018, 09:52:03 AM
I think I have corrected all of them.

Thanks!
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: Breezy on September 27, 2018, 12:41:44 AM
Ken,

Have downloaded and installed your modified scripts but the Google Map will not load. Any ideas? http://indiantrailweather.com/wxradio.php

Thank you
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: saratogaWX on September 27, 2018, 10:39:47 AM
With the new script, there is no Google map.. it is a Leaflet/OpenStreetMap map now.

Testing with http://indiantrailweather.com/radios.php (the non-template page) shows you have installed the scripts correctly.

The issue with your wxradio.php template page is that it is not the wxradio.php included with the distribution, but a modified version and I think that is the issue.. some of the old Google-map stuff is still on that page, and a different version of JQuery seems to be loaded.   I'd suggest you use the wxradio.php from the distribution, and debug that first.
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: Breezy on September 27, 2018, 10:51:26 AM
Thanks Ken. Will load the original wxradio.php script and debug. Much appreciated!

Update: Got it Ken. Thank you!  \:D/
Title: Re: NOAA Weather Radio ORG Saratoga Script
Post by: saratogaWX on February 11, 2019, 05:42:26 PM
Old thread, but a change of www.nws.noaa.gov to https only necessitates a change to the NWR-radios.js script

Download the change at https://saratoga-weather.org/NWR-radios.js or the full package at https://saratoga-weather.org/scripts-wxradio.php