WXSIM "EWN-style"

Henkka,

The $uoms looks correct to me.


#$uoms = array('C','mm','km/h','hPa','cm','km');
$uoms = array('F','in','mph','inHg','in','mi');

Steve

Hi Henkka,
Sorry late response, checked all Lat /Lon settings all correct.
I did some searching on the net and found those 2 scripts to be slightly flawed, also checked your site and TylerTexas (both showing incorrect Moon (Rise/Set) Times also.
Not sure what the answer is.

Also just noticed that UV is not utilized, would UV be difficult to add as it was in the 3in1.
Kind regards,

The $uoms looks correct to me.

Yep. But source-code of http://tylertexasweather.com/wxsim-ewn/forecast.php have theese:


var snowset="cm",baroset="hPa",wiset="ms",piset="mm",tiset="c";

so it seems it reads them from some other file.

I did some searching on the net and found those 2 scripts to be slightly flawed, also checked your site and TylerTexas (both showing incorrect Moon (Rise/Set) Times also. Not sure what the answer is.

I haven’t “quality-chekced” them so it its fully possible. They was the only one i found for the moon-stuffs. I someone finds any better working with PHP will i happily do a switch.

Also just noticed that UV is not utilized, would UV be difficult to add as it was in the 3in1.

It shouldn’t be difficult. Why they are not there are that there are no UV-data in the EWN forecast-data so there was no UV-row in the orginal script + also that no UV at this time of the year up here so been difficult to test it.

// Henkka

Hi Henkka,
Not sure if I can help with an alternative script - I have used the following (attached: sunmoon.php.txt) in the past which is returns correct times, though not sure if you could adapt it.

Should return an array similar to this :

Array ( [solarNoon] => DateTime Object ( [date] => 2017-02-19 13:27:22.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) [nadir] => DateTime Object ( [date] => 2017-02-19
 01:27:22.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) [sunrise] => DateTime Object ( [date] => 2017-02-19 06:39:16.000000 [timezone_type] => 3 [timezone] => Australia/Hobart )
 [sunset] => DateTime Object ( [date] => 2017-02-19 20:15:29.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) [sunriseEnd] => DateTime Object ( [date] => 2017-02-19 06:42:19.000000
 [timezone_type] => 3 [timezone] => Australia/Hobart ) [sunsetStart] => DateTime Object ( [date] => 2017-02-19 20:12:26.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) [dawn] => DateTime
 Object ( [date] => 2017-02-19 06:09:18.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) [dusk] => DateTime Object ( [date] => 2017-02-19 20:45:27.000000 [timezone_type] => 3 [timezone]
 => Australia/Hobart ) [nauticalDawn] => DateTime Object ( [date] => 2017-02-19 05:33:00.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) [nauticalDusk] => DateTime Object ( [date] => 2017-
02-19 21:21:44.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) [nightEnd] => DateTime Object ( [date] => 2017-02-19 04:54:09.000000 [timezone_type] => 3 [timezone] => Australia/Hobart )
 [night] => DateTime Object ( [date] => 2017-02-19 22:00:36.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) [goldenHourEnd] => DateTime Object ( [date] => 2017-02-19 07:17:45.000000
 [timezone_type] => 3 [timezone] => Australia/Hobart ) [goldenHour] => DateTime Object ( [date] => 2017-02-19 19:37:00.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) ) 

Array ( [fraction] => 0.48381924324166 [phase] => 0.75515139425707 [angle] => 1.7675452111715 ) 

Array ( [moonrise] => DateTime Object ( [date] => 2017-02-19 00:08:07.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) [moonset] => DateTime Object ( [date] => 2017-02-19
 14:31:06.000000 [timezone_type] => 3 [timezone] => Australia/Hobart ) ) 

Also: That would be excellent if we could get the UV included, if it is on any assistance I have (attached my : lastret.txt) which always has ( UVI and S.IR ) here in Tasmania.

Kind regards,


lastret.txt (105 KB)

sunmoon.php.txt (9.87 KB)

I have downloaded latest version and it’s mostly working. It can be seen here:
http://www.shermanctweather.org/ewn/wxsim/forecast.php

My only problem is I can’t get description to work. I’m not sure if that has anything to do with the folder “lang”.
My lastret can be seen here:
http://www.shermanctweather.org/lastret.txt

I haven’t really figured out where that folder “lang” comes from.
Thanks
Tom

Hi Tom,

What seems to be missing is your “plaintext.txt” file, I see it is in same directory as your “lastret.txt” file, so the path to it must be incorrect in your other files.
The file “plaintext.php” In directory: …wxsim/wxsim/plaintext.php should be setup as per attached : so it finds the “plaintext.txt” file.
Unless of course you have modified the other scripts and changed the path structure for looking up “lastret.txt”
regards,


plaintext.php.txt (19.5 KB)

Tony,
My plaintext.txt file is in my root directory where my lastret.txt is also.
I copied your plaintext.php but it still doesn’t work. The only file I’ve changed is the config file.
I put a copy of the plaintext.txt in …wxsim/wxsim folder but no success.
I’m still confused.
Thanks for trying to help.
Tom

My only problem is I can't get description to work. I'm not sure if that has anything to do with the folder "lang".

Thats really strange. Could you post your plaintext.txt and i can test here?
The descriptions have nothing to do with the lang-directory, plaintext-parser use the old good plaintext-parser*-files

Not sure if I can help with an alternative script - I have used the following (attached: sunmoon.php.txt) in the past which is returns correct times, though not sure if you could adapt it.

Thanks. I will give a run and see.

btw. UV-icons added to my dev-version. :slight_smile:

Here is my plaintext.txt
http://www.shermanctweather.org/plaintext.txt

Tom

btw. UV-icons added to my dev-version. :)

Thanks Henkka =D>,
regards,

The descriptions shows up OK on my dev: https://www.nordicweather.net/test/wxsim/forecast.php (note its a mix of my lastret, your plaintext and metric $uoms). Hmmm…

Zip updated with UV-icons and the new sunmoon-script. :slight_smile:

// Henkka

Henkka,
Downloaded newest version, didn’t change anything but the path to your lastret.txt and still no description.

Tom

Zip updated with UV-icons and the new sunmoon-script. :)

Hi Henkka, you are a legend, all works perfect strait out of the box. =D>

UV (tick)
Sunrise/Set (tick)
MoonRise/Set (tick)
Note: both sun and moon within 2 or 3 mins of say comparing against https://www.timeanddate.com/moon/australia/hobart more than happy with that, great stuff Henkka.
Only thing I need to do now is work out how to change the Moon Phase Icon from Northern to Southern Hemisphere (ie. reversed) but that is not an issue if I can’t.
Kind Regards,


A tought i got is that it have something to do with the encoding of the description-text as JSON are tricky on that. I will add a check for that so we at least rule it out.

Only thing I need to do now is work out how to change the Moon Phase Icon from Northern to Southern Hemisphere (ie. reversed) but that is not an issue if I can't.

You mean the moon should need to be rotated 180

I have been trying for a while to get this working, but no luck. I just get the spinning circle (see attachment). I’m quite sure that my paths are correct. And it must be able to find lastret.txt since the update time is correct. Any ideas?


Hi Henkka

Cost me 2 hours fiddeling but working (out of the box) had some issues find language path #-o
thanks for your work as allways !

sounds to me path to files in config.php (had it by myself :lol:)

I thought about that. But I’m not able to find any errors there. Here is what I have:

$path_to_langfiles = “wxsim_ewn/wxsim/”;
$path_to_lastret = “wxsim_ewn/wxsim/lastret.txt”;
$path_to_js = “wxsim_ewn/js/”;
$path_to_css = “wxsim_ewn/css/”;

I have the HTML file at the top. Then /wxsim_ewn. Under that I have /css, /js and /wxsim
It finds the language file. It also seem to find lastret.txt since the update date is correct.

Can anybody see what is wrong?

is that the complete path from ./web or similar ? be sure to have that !

at my site I had too fiddle before I had all settings right :

…/…/…/clientraw/wd-ajax-ml/wxsim_ewn/wxsim/

etc !

That is the paths from where the HTML-file is. And from what I see all of them are accessed. I see now that the pop-up texts show when moving the mouse. Then the js-file must be accessed?

[quote]
You mean the moon should need to be rotated 180