IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

I strongly advise all users using my server for their web site to make alternative arrangements.

Outgoing mail is disabled because of the malware on the server. No new forum registrations are currently possible, and mail to the forum administrator will not work.

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

WU-forecast.php

Discussion of Ken True's web site templates

Moderator: saratogaWX

User avatar
Mapantz
Posts: 500
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: WU-forecast.php

Postby Mapantz » Fri May 18, 2018 8:05 pm

I seem to suffer so badly with the WU problem. For weeks now, it is breaking 30+ times a day. I check yours, Simon, and it's working for you. I just don't get it?! :(
Image
Image

User avatar
Toxic17
Posts: 698
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Sun May 20, 2018 1:25 am

Mapantz wrote:I seem to suffer so badly with the WU problem. For weeks now, it is breaking 30+ times a day. I check yours, Simon, and it's working for you. I just don't get it?! :(


i added a bit of code as I found either my ./cache/WU-forecast-json-0-en.txt would be 0 bytes of incomplete. it still happens from time to time, but is much more stable.

top of my WU-Forecast.php Version 3.04 - 27-Feb-2018

Code: Select all

<?php
$filename = './cache/WU-forecast-json-0-en.txt';

if (file_exists($filename)) {

$zerosize = filesize('./cache/WU-forecast-json-0-en.txt');

if ($zerosize < 23000) {
// if ($zerosize == 0) {
unlink('./cache/WU-forecast-json-0-en.txt');
} }
// WU-forecast.php script by Ken True - webmaster@saratoga-weather.org
//
// Version 1.00 - 02-Sep-2007 - initial release


I found the cache when complete is about 25/26kb in file size and have had incomplete files of upto 20kb in size. its just WU as usual.
Regards Simon

https://www.conligwx.org
https://www.conligwx.org/pws/
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
Mapantz
Posts: 500
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: WU-forecast.php

Postby Mapantz » Sun May 20, 2018 2:02 pm

Toxic17 wrote:
Mapantz wrote:I seem to suffer so badly with the WU problem. For weeks now, it is breaking 30+ times a day. I check yours, Simon, and it's working for you. I just don't get it?! :(


i added a bit of code as I found either my ./cache/WU-forecast-json-0-en.txt would be 0 bytes of incomplete. it still happens from time to time, but is much more stable.


Thank you Simon. I've added that to the top, let's see how she holds up?! :D
Image
Image

User avatar
Mapantz
Posts: 500
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: WU-forecast.php

Postby Mapantz » Tue May 22, 2018 10:57 am

Quick update. Everything much better. I still get an empty forecast now & then, but instead of 30 times a day, it's just a couple. :)
Image
Image

User avatar
Toxic17
Posts: 698
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Tue May 22, 2018 1:55 pm

Mapantz wrote:Quick update. Everything much better. I still get an empty forecast now & then, but instead of 30 times a day, it's just a couple. :)


yep its not perfect, but then again WU is the issue, not our scripts.
Regards Simon

https://www.conligwx.org
https://www.conligwx.org/pws/
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
Mapantz
Posts: 500
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: WU-forecast.php

Postby Mapantz » Sat May 26, 2018 7:06 pm

Normal service resumed! :(

It doesn't seem to make any difference for me. The file is some times 0 bytes, 18KB, 19KB, 21KB, 23KB and even 50KB. Damn WU.
Image
Image

User avatar
Mapantz
Posts: 500
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: WU-forecast.php

Postby Mapantz » Mon Jun 25, 2018 10:36 pm

Hi Ken!

I use: $maxForecastLegendWords = 5; just to keep the wording small under the icons. Obviously, this will also only show a maximum of 5 words in the tooltip when you hover over the icon. Is there an easy change I could make where I keep the words to 5 under the icon, but show the full forecast sentence when I hover over the icon?

Nice fix in 3.05 by the way, much more stable. :)

Regards.
Image
Image


Return to “Saratoga Templates”

Who is online

Users browsing this forum: No registered users and 2 guests