Page 21 of 22

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

Posted: Sat 09 Feb 2019 7:11 pm
by odintheterrible
Hi,
Mine's been like that too for a couple of days. I thought it was because our local airport has now closed and revert to sole use by the Spanish Airforce and so now doesn't have an ICAO code. I edited the code in the php file to use the code for our new regional airport, but it didn't make any difference ... so, I too am at a loss to explain what is going on.
For the time being I've reverted to the Cumulus forecast.
I hope it can be sorted. :roll:

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

Posted: Sat 09 Feb 2019 8:20 pm
by mcrossley
M1DUL wrote: Sat 09 Feb 2019 6:54 pm Hi All,
I have just had a look at my weather website and I noticed that my weather forecast say's Forecast Unavailable, I have had a look at other peoples website and there's is doing the same.
Looks like it is working again.

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

Posted: Sat 09 Feb 2019 9:04 pm
by M1DUL
mcrossley wrote: Sat 09 Feb 2019 8:20 pm Looks like it is working again.
That is strange very, It is still not working for me.

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

Posted: Sat 09 Feb 2019 9:16 pm
by PaulMy
Mine has not worked for a few days, and still not http://www.komokaweather.com/weather/bt-sager.php

Paul

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

Posted: Sat 09 Feb 2019 9:32 pm
by M1DUL
M1DUL wrote: Sat 09 Feb 2019 9:04 pm That is strange very, It is still not working for me.
Mine is now working again too. :)

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

Posted: Sat 09 Feb 2019 10:01 pm
by beteljuice
None of those links are currently giving a forecast to me ...

Is there something changed in the METAR look-ups recently, and would that prevent a forecast ?

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

Posted: Sat 09 Feb 2019 10:10 pm
by M1DUL
beteljuice wrote: Sat 09 Feb 2019 10:01 pm None of those links are currently giving a forecast to me ...

Is there something changed in the METAR look-ups recently, and would that prevent a forecast ?
Mine has now stoped again it is all very stragine. it was working now it is not. :(

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

Posted: Sat 09 Feb 2019 11:23 pm
by beteljuice
I've just looked at the code for the first time ....

The bt-sager.php is typically returning something like:

Code: Select all

12-24 Hour Forecast:
document.write ('Forecast Unavailable');Z13: Forecast Unavailable
The 'code' returned before the forecast should be in the format: A123 - so one or two entries missing from METAR decode.

In bt-sager-wc.php there is no fall-back for a METAR fail other than the general message you get.
METAR look-up has now changed subtly
Line #24

Code: Select all

curl_setopt ($metarwx, CURLOPT_URL, "http://tgftp.nws.noaa.gov/data/observations/metar/stations/$ms.TXT");
This should now be: "https://tgftp.????????????????

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

Posted: Sun 10 Feb 2019 4:50 am
by PaulMy
Thank you, the "s" made the difference http://www.komokaweather.com/weather/bt-sager.php

Enjoy,
Paul

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

Posted: Sun 10 Feb 2019 9:35 am
by odintheterrible
Yes, the secure server change in the web address was the culprit ... change made, and now it's all working again.
Thanks fly out to 'beteljuice' for the input :clap:

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

Posted: Mon 18 Feb 2019 9:02 am
by uncle_bob
Damn it, it didn't fix mine.

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

Posted: Mon 18 Feb 2019 9:12 pm
by beteljuice
Are sure you have correctly changed the url to https: ?
currently:

Code: Select all

2019/02/18 20:30
YSCB 182030Z AUTO 34001KT 9999 // NCD 16/14 Q1008 RF00.0/000.0
So the station is up and running OK.

Back-up your bt-sager-wc.php and change the Begin METAR section to this:

Code: Select all

// Begin METAR:
	echo "<!-- getting METAR for ".$ms. " -->\n";
// METAR Report:
	$metarwx = curl_init();
	curl_setopt ($metarwx, CURLOPT_URL, "https://tgftp.nws.noaa.gov/data/observations/metar/stations/$ms.TXT");
	curl_setopt ($metarwx, CURLOPT_RETURNTRANSFER, 1);
	$metar = curl_exec ($metarwx);
	curl_close ($metarwx);

	if(!$metar || !strpos ($metar, $ms)) {
		echo "<!-- METAR FAIL or corrupted ".$metar. " -->\n";

	} else {
		echo "<!-- METAR OK -->\n";

	}

// Removes unnecessary slashes from $metar:
Then view bt-sager.php (Which is really a status / debug page)

If you have "Forecast Unavailable" view page source and you should see "<!-- comment -->" on the METAR grab.
If successful you would see:

Code: Select all

<!-- getting METAR for YSCB -->
<!-- METAR OK -->

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

Posted: Tue 19 Feb 2019 12:13 pm
by beteljuice
As there was a little confusion recently when there was a url change, and as there has been no activity from BTJ for some time, plus his links don't work anymore ...

The beteljuice has done a little 'house-keeping'

It would be a great shame for this excellent piece of work to fade away and it really does deserve a wider audience.

So the beteljuice has updated the the METAR urls, improved error handing and reporting, and .....
this version now has separate 'language' files and is compatible with most of your favourite templates.

To avoid confusion and make life easier for anyone who does 'language' updates I have created a separate topic here: viewtopic.php?f=14&t=17311

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

Posted: Tue 19 Feb 2019 8:17 pm
by odintheterrible
Greetings,
Looking for a bit of input/help on this one please ... I've installed/incorporated the BT-Sager script into the Cumulus web output and it seems to be working very well with quite accurate forecasts; all be it that our local weather here in our region of Spain IS VERY localised.

https://drive.google.com/open?id=1CEOJK ... 0jVdWLznn_

The 'problem' is that if I access the station data via the :8998 ported page, the forecast reads out with the standard Cumulus forecast ...

https://drive.google.com/open?id=1YVh6q ... cnDIp-Ny2m

Can anyone tell me if it is possible to correct this so that the port page (:8998) displays the BT-Sager forecast for continuity with the web output ????

Many thanks in anticipation

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

Posted: Tue 19 Feb 2019 8:51 pm
by PaulMy
@beteljuice, why the difference between the previous BT-Justice and the new beteljuice version?
Cumulus1 /weather/bt-sager-wc.php
document.write ('Unsettled and warmer; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. Southwest or West winds.');

CumulusMX /cumulusmx/bt-sager/bt-sager-wc.php
document.write ('Unsettled and warmer; Diminishing, or moderating somewhat if current winds are of fresh to strong velocity. West or Southwest winds.');

Enjoy, ;)
Paul