Page 22 of 23

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

Posted: Fri 22 Mar 2019 4:53 pm
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.

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

Posted: Wed 24 Jun 2020 8:47 pm
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

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

Posted: Wed 24 Jun 2020 9:08 pm
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>

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

Posted: Wed 24 Jun 2020 9:16 pm
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

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

Posted: Wed 24 Jun 2020 9:27 pm
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.

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

Posted: Wed 24 Jun 2020 9:50 pm
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

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

Posted: Thu 25 Jun 2020 6:54 am
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.

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

Posted: Thu 25 Jun 2020 12:36 pm
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 ....

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

Posted: Thu 25 Jun 2020 10:01 pm
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.

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

Posted: Thu 25 Jun 2020 10:18 pm
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 ??

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

Posted: Sat 27 Jun 2020 3:39 pm
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.

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

Posted: Fri 24 Jul 2020 8:43 am
by Buford T. Justice
I need to stop procrastinating on this forum, lol. I'll have an update to these scripts coming soon. I swear!

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

Posted: Sat 12 Dec 2020 11:17 pm
by Buford T. Justice
Version 2020-12-12 is now live. It is attached to the bottom of the first post in this thread.

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

Posted: Sun 13 Dec 2020 6:35 am
by Buford T. Justice
One thing I have been working on is finding a source online to where the weather station's GPS coordinates can be used to tell the current sky/cloud conditions. If I could get this condition as a variable somehow, I could strip out the METAR code and requirement.

Another thing is PHP 7. I am not 100% sure if the scripts in their current form will work with PHP 7.

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

Posted: Tue 27 Aug 2024 9:22 am
by water01
My forecast has been working for years, now all of a sudden I am getting

Code: Select all

Uncaught SyntaxError: Unexpected token '<'  in bt-sager-wc php 1
Well at least it does this sometimes and other times it works fine.

The strange thing is what it is indicating in the developer console is the opening "<?php " which cannot be right.

Anybody got any clue as to what may be happening?