It is currently September 20th, 2019, 10:41 am

MoonCalc Infos

Help with creating, editing & fixing problems with skins
User avatar
GTI.H
Posts: 72
Joined: December 15th, 2018, 3:35 am

MoonCalc Infos

GTI.H » February 26th, 2019, 2:25 am

Hello,

How can I extract the information in "Lunar data for the selected location" from this website to use in my skin ?

Or what is the best way to get this informations ?

Every help is welcome. :???:

Edit: website HTML syntax (Not the url)
Last edited by GTI.H on February 28th, 2019, 4:30 pm, edited 4 times in total.
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoonCalc Infos

balala » February 26th, 2019, 8:02 am

GTI.H wrote:
February 26th, 2019, 2:25 am
How can I extract the information in "Lunar data for the selected location" from this website to use in my skin ?
Probably you can't, because it seems the site uses some java scripts to show up all the information. But anyway I'd recommend not to use a such site as source, a xml would be much better. All those information are available on the weather.com as well and this one has the advantage that there are a lot of skins on both, the Share Your Creations section of this forum and on DeviantArt.com, which can be used to parse all those data.
GTI.H wrote:
February 26th, 2019, 2:25 am
Or what is the best way to get this informations ?
There is one more possibility. Many of those information can be calculated locally as well, without having to use WebParser measures to download them. For example: https://forum.rainmeter.net/viewtopic.php?f=27&t=24740&p=130794&hilit=sunmoon#p130759. This skin I wrote more than two years ago, uses a small .lua script file (and another one to the calculations related to the Sun), to make locally all calculations. It can calculate the moment of Moon/Sun rise/set, using the local geographical coordinates, which have to be added as variables.
User avatar
GTI.H
Posts: 72
Joined: December 15th, 2018, 3:35 am

Re: MoonCalc Infos

GTI.H » February 26th, 2019, 3:25 pm

Hi balala,

Thanks for the reply!
balala wrote:
February 26th, 2019, 8:02 am
... But anyway I'd recommend not to use a such site as source, a xml would be much better. ...
Yes, I know that with xml is feasible, but where do I get the xml of this website?
balala wrote:
February 26th, 2019, 8:02 am
... All those information are available on the weather.com ...
When I looked, I did not see "Moon Rise, Moon Set, Moon Distance, Moon Altitude, Moon Azimuth" on xml weather.com, could you show me?
balala wrote:
February 26th, 2019, 8:02 am
There is one more possibility. Many of those information can be calculated locally as well, without having to use WebParser measures to download them. For example: https://forum.rainmeter.net/viewtopic.php?f=27&t=24740&p=130794&hilit=sunmoon#p130759. This skin I wrote more than two years ago, uses a small .lua script file (and another one to the calculations related to the Sun), to make locally all calculations. It can calculate the moment of Moon/Sun rise/set, using the local geographical coordinates, which have to be added as variables.
I have a lua script (SUNCALC.LUA / raiguard / v1.0.5), but I try to avoid the use of scripts to the maximum.

The information I most need now is "Moon Azimuth" and the informations for location of the moon in the sky:
"Moon Rise, Moon Set, Moon Distance, Moon Altitude, Moon Azimuth"

I do not know a Skin that has this information I need, do you know it?
User avatar
GTI.H
Posts: 72
Joined: December 15th, 2018, 3:35 am

Re: MoonCalc Infos

GTI.H » February 26th, 2019, 6:06 pm

I noticed that the informations is in HTML, would not it be possible to extract it from HTML?
MoonCalc HTML.JPG
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoonCalc Infos

balala » February 26th, 2019, 6:15 pm

GTI.H wrote:
February 26th, 2019, 3:25 pm
Yes, I know that with xml is feasible, but where do I get the xml of this website?
Probably nowhere on that site, but I'm not sure. You have to find it if there is any.
GTI.H wrote:
February 26th, 2019, 3:25 pm
When I looked, I did not see "Moon Rise, Moon Set, Moon Distance, Moon Altitude, Moon Azimuth" on xml weather.com, could you show me?
Unfortunately those are not there. Just the Sunrise and Sunset, but no the Moonrise and Moonset. My mistake, sorry...
GTI.H wrote:
February 26th, 2019, 3:25 pm
I have a lua script (SUNCALC.LUA / raiguard / v1.0.5), but I try to avoid the use of scripts to the maximum.
Why? They are working good, no problems with them.
GTI.H wrote:
February 26th, 2019, 3:25 pm
The information I most need now is "Moon Azimuth" and the informations for location of the moon in the sky:
"Moon Rise, Moon Set, Moon Distance, Moon Altitude, Moon Azimuth"

I do not know a Skin that has this information I need, do you know it?
The Moonrise, Moonset and the distance are available in my SunMoon skin, along with the current phase, illumination, elongation, age and the number of days until new moon, full moon and so on. Have you tried it out?
User avatar
jsmorley
Developer
Posts: 19461
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MoonCalc Infos

jsmorley » February 26th, 2019, 6:28 pm

You will not be able to parse that site.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache Server at default-2001_8d8_9a0_8800__23_cdd1 Port 443</address>
</body></html>
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoonCalc Infos

balala » February 26th, 2019, 6:31 pm

GTI.H wrote:
February 26th, 2019, 6:06 pm
I noticed that the informations is in HTML, would not it be possible to extract it from HTML?
Besides jsmorley's reply, I don't know how have you got that source code, because I get just this:

Code: Select all

<span style="white-space: nowrap;" id="clickSunrise" class="time-span sunrise sunrise-time">...</span></td>
As you can see there is no data. Searching through the whole content of the source code, I can't find the hour shown in the browser. So, how have you got the image?
User avatar
jsmorley
Developer
Posts: 19461
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MoonCalc Infos

jsmorley » February 26th, 2019, 6:42 pm

balala wrote:
February 26th, 2019, 6:31 pm
Besides jsmorley's reply, I don't know how have you got that source code, because I get just this:

Code: Select all

<span style="white-space: nowrap;" id="clickSunrise" class="time-span sunrise sunrise-time">...</span></td>
As you can see there is no data. Searching through the whole content of the source code, I can't find the hour shown in the browser. So, how have you got the image?
The debug tools in your browser are a different animal than just the raw source code on the site.
User avatar
jsmorley
Developer
Posts: 19461
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MoonCalc Infos

jsmorley » February 26th, 2019, 6:58 pm

WebParser simply connects to a resource and "downloads" whatever is presented when the resource is connected to. That is going to be the raw source text from any web site, presumably, but not necessarily, HTML. If the site in any way uses server-side or client-side Javascript, that script is NOT "executed" by WebParser. It's not a web browser. It doesn't understand HTML tags, Javascript commands, or anything else. What is downloaded and parsed is the TEXT that the site presents when it is accessed.
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoonCalc Infos

balala » February 26th, 2019, 7:05 pm

jsmorley wrote:
February 26th, 2019, 6:42 pm
The debug tools in your browser are a different animal than just the raw source code on the site.
Ok, just to be short enough, I think the information needed by GTI.H can't be accessed by WebParser measures, right? This was my first tip, inmy first reply of this topic, as well.