Page 9 of 13

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sun 05 Jan 2014 11:42 pm
by n9mfk
Hi BCJKiwi,
I noticed that daytime is be reported at night

http://99.148.153.229/weather/test3/clo ... php?html=1
beau

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Mon 06 Jan 2014 1:22 am
by BCJKiwi
The day night info comes directly from the cloudbaseT.txt data file through the tag <#isdaylight> so if cloudbase has it wrong, then Cumulus is sending the wrong info (or the script has been changed?). So please check the Cumulus setup (and that the file is being uploaded?).

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Mon 06 Jan 2014 8:19 am
by steve
17:06 would have been before dusk (which is about 17:19 for you now) hence 'isdaylight' would correctly have been 'true'.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 19 Jul 2014 12:51 pm
by Mark14
I uploaded CloudBase script and it works fine: http://slesinpogoda.cba.pl/cloudbaseCU.php

Now I would like to replace the Outlook window with WU forecast with CloudBase script, just like here: http://silveracorn.co.nz/weather/
Could you tell me where (what file) I should change the code? Is it to add only "<img src="cloudbaseCU.php" alt="cloudbase" width="100" height="200" />"?

My website: http://slesinpogoda.cba.pl/wxindex.php All upgrades done.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 19 Jul 2014 2:17 pm
by n9mfk
That is in ajax-dashboard.php
line 359 and 675 to 681

Beau

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sun 20 Jul 2014 7:19 am
by Mark14
Done :) Thanks for help. You saved my time.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 9:33 am
by gluepack
Oops! I am using MX now, so don't know if that is the problem (I thought that I had checked everything since switching) but somehow cloudbaseCU has failed due to a generated request for SH-moon43.gif that a) doesn't exist and b) it is daytime.

Text file is...
24.4 18.1 0.0 15 1010.6 68 5.0 360 755 C mm hPa km/h m 43 7 1 935 0.0 0.0

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 9:59 am
by steve
There seems to be a problem with the parsing of the data file, so it's getting the wrong fields for some of the items. I don't know whether this is because of something that MX is doing differently. It looks like the script is taking your latitude (43) as the moon age, rather than the 7 following it, which is the actual moon age. Similarly, it's looking at the wrong field for 'is daylight'.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 10:05 am
by gluepack
Looks like it gets condensed in my post but in the editor there appears to be an additional blank (or non-displayable) between m and 43
cloudbaseCU.txt

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 10:15 am
by steve
The code in Cumulus (1 and MX) which handles the latitude 'dp' parameter pads the field to a minimum width of dp+3, so in the case of dp=0, there's a leading space. Presumably the script expects a single space as delimiter rather than one or more spaces.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 10:19 am
by steve
Assuming it does work OK with a file generated by Cumulus 1, then the floating point formatting routines in Delphi must work differently to those in .Net - Delphi truncates and .Net pads left with spaces.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 10:22 am
by gluepack
Not sure what you are suggesting.

Sounds like you are saying that the same situation would have occurred with Cu1, which isn't the case.

Oh, just saw your 2nd response. So... you will do something about it?

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 10:29 am
by steve
I'll have a look at it to see what I can do.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 10:44 am
by steve
If you change this line in the script:

Code: Select all

$data = explode(' ',$file[0]);
to

Code: Select all

$data = preg_split('/\s+/',$file[0]);
it will split the string using one or more whitespace characters as delimiters.

Re: CloudBase script for Cumulus Ver CU1.5

Posted: Sat 22 Aug 2015 10:54 am
by gluepack
Thanks for that.
I was just looking at the code and saw the $data = explode(' ',$file[0]); but was struggling to think how I could change it.
Will give it a try.

Update: Thanks, that worked great!