Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.6.10 (build 3086) - 24 June 2020 (please see important announcement regarding releases since 3.5.0)
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of the NOAA report and Snow Index drop-down menus to 2030)

See the Wiki to download the software or click on the Downloads link in the Forum Banner.

BT's Global Sager Weathercaster PHP Scripts For Cumulus

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
Buford T. Justice
Posts: 406
Joined: Fri 17 Aug 2012 9:21 pm
Weather Station: Ecowitt GW1000 with WS-2902A
Operating System: Windows 10 Pro 64-bit
Location: USA

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by Buford T. Justice »

I had to move on to an Ambient Weather WS-2902A weather station which Cumulus MX doesn't presently support. I hope maybe one of the programmers here can add Ambientweather.net API support to Cumulus MX:

https://www.ambientweather.com/api.html

If I was able to use Cumulus MX, I would be updating this script regularly.

I have to use Weather Display to report to places like CWOP.

I'm glad someone found that the address requires https now for some airports.

User avatar
ConligWX
Posts: 759
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis VPro2 Plus +DFARS
Operating System: MeteoBridge Nano SD
Location: Bangor, NI
Contact:

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by ConligWX »

Just installed this on a test site but I was not seeing the forecast displayed on the cumulusmx index.htm page.

it was blank where the forecast should be.

bt-sager.php shows the correct displayed forecast.

inspected the index.htm page and error shows:

Code: Select all

Refused to execute script from 'https://www.conligwx.org/cmx/bt-sager-wc.php' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
anyone know how to fix this?

https://www.conligwx.org/cmx/bt-sager.php

https://www.conligwx.org/cmx/index.htm
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus + DFARS - Meteobrige Nano SD + CumulusMX + Saratoga Templates

Mapantz
Posts: 748
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64
Location: Dorset - UK
Contact:

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by Mapantz »

ConligWX wrote:
Wed 24 Jun 2020 8:47 pm
Just installed this on a test site but I was not seeing the forecast displayed on the cumulusmx index.htm page.

it was blank where the forecast should be.

bt-sager.php shows the correct displayed forecast.

inspected the index.htm page and error shows:

Code: Select all

Refused to execute script from 'https://www.conligwx.org/cmx/bt-sager-wc.php' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
anyone know how to fix this?

https://www.conligwx.org/cmx/bt-sager.php

https://www.conligwx.org/cmx/index.htm
Try putting this in your .htaccess file

Code: Select all

<filesMatch "\.(html|htm|php)$">
 FileETag None
 <ifModule mod_headers.c>
 Header unset ETag
 Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
 Header set Pragma "no-cache"
 Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>
Image

User avatar
PaulMy
Posts: 2176
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis Vantage Pro 2+ w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by PaulMy »

I just checked mine and see that the forecast is not showing on my Cumulus home page, but likely a different reason to yours. However both www.komokaweather.com/weather/bt-sager-wc.php and www.komokaweather.com/weather/bt-sager.php do display.

If I recall correctly, I had to change to indexT.php ==> index.php as an added file to process and FTP for this script to execute.

BTJ has recently revisited the forum and hopefully he will see your post.

Enjoy,
Paul

User avatar
ConligWX
Posts: 759
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis VPro2 Plus +DFARS
Operating System: MeteoBridge Nano SD
Location: Bangor, NI
Contact:

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by ConligWX »

Mapantz wrote:
Wed 24 Jun 2020 9:08 pm

Try putting this in your .htaccess file

Code: Select all

<filesMatch "\.(html|htm|php)$">
 FileETag None
 <ifModule mod_headers.c>
 Header unset ETag
 Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
 Header set Pragma "no-cache"
 Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>
Thanks for the tip, though I get the same issue.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus + DFARS - Meteobrige Nano SD + CumulusMX + Saratoga Templates

User avatar
beteljuice
Posts: 2950
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: ex XP SP3 - now W10 laptop grr
Location: Dudley, West Midlands, UK

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by beteljuice »

As you are using javascript to write into the html page, ensure the bottom of bt-sager-wc.php

looks like this:

Code: Select all

echo "document.write ('$sf');";// This allows displaying the forecast on a HTML webpage.  Add // to the front of this line if using a PHP webpage.
// End The Sager Weathercaster.
ie. echo is NOT commented out.

As Paul showed, if you go to bt-sager-wc.php you should see document.write('your forecast ......

There are some legacy problems with this code ....
you may want to try this modified version
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
ConligWX
Posts: 759
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis VPro2 Plus +DFARS
Operating System: MeteoBridge Nano SD
Location: Bangor, NI
Contact:

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by ConligWX »

thankx for the heads up but the new v2 files give more issues as stated in your thread. it also gives the same initial error message of refusing to execute script from 'https://www.conligwx.org/cmx/bt-sager-wc.php' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Guess these script are no longer compatible with newer versions of php and web browser policies.

thanks for all you help guys. I'll leave it for now.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus + DFARS - Meteobrige Nano SD + CumulusMX + Saratoga Templates

User avatar
beteljuice
Posts: 2950
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: ex XP SP3 - now W10 laptop grr
Location: Dudley, West Midlands, UK

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by beteljuice »

Try ..

<a href = "bt-sager.php" style = "text-decoration:none;" target = "_blank"><b><font color = "#FF0000" face = "Tahoma" size = "4"><script src = "bt-sager-wc.php" type = "application/javascript"></script></font></b></a></p>

Edit:
If that doesn't work try ...

<a href = "bt-sager.php" style = "text-decoration:none;" target = "_blank"><b><font color = "#FF0000" face = "Tahoma" size = "4"><script src = "bt-sager-wc.php" type = "application/x-httpd-php"></script></font></b></a></p>

Let us know if either of them work ;)

It's the server being fussy ....
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
ConligWX
Posts: 759
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis VPro2 Plus +DFARS
Operating System: MeteoBridge Nano SD
Location: Bangor, NI
Contact:

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by ConligWX »

beteljuice wrote:
Thu 25 Jun 2020 12:36 pm
Try ..

Let us know if either of them work ;)

It's the server being fussy ....
yep tried them both and one reported the usual error, the other reported nothing. Thanks for you help though. I'll leave it be. Thanks everyone.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus + DFARS - Meteobrige Nano SD + CumulusMX + Saratoga Templates

User avatar
beteljuice
Posts: 2950
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: ex XP SP3 - now W10 laptop grr
Location: Dudley, West Midlands, UK

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by beteljuice »

How odd ....

Your server seems to be running php, but not recognizing they are executable pages ...

Do you have any php code running anywhere ??
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
ConligWX
Posts: 759
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis VPro2 Plus +DFARS
Operating System: MeteoBridge Nano SD
Location: Bangor, NI
Contact:

Re: BT's Global Sager Weathercaster PHP Scripts For Cumulus

Post by ConligWX »

beteljuice wrote:
Thu 25 Jun 2020 10:18 pm
How odd ....

Your server seems to be running php, but not recognizing they are executable pages ...

Do you have any php code running anywhere ??
php scripts are working, just they dont work in htm pages:) I'll reply with more info in your V2 script page.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus + DFARS - Meteobrige Nano SD + CumulusMX + Saratoga Templates

Post Reply