Thanks jsmorley!
With your explanation, everything is easier.
Thank you, now I understand!
OK!
We are demanding a lot from WebParser, but would it be possible for Rainmeter to download the website via web browser (Chrome), and use WebParser or another to extract the information from the downloaded file?
It is currently April 27th, 2024, 4:45 pm
MoonCalc Infos
-
- Posts: 75
- Joined: December 15th, 2018, 3:35 am
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: MoonCalc Infos
No, sorry.GTI.H wrote: ↑February 26th, 2019, 11:53 pm Thanks jsmorley!
With your explanation, everything is easier.
Thank you, now I understand!
OK!
We are demanding a lot from WebParser, but would it be possible for Rainmeter to download the website via web browser (Chrome), and use WebParser or another to extract the information from the downloaded file?
I'm not trying to rain on your parade, I just am trying to describe what Rainmeter can and can't do. You can't use WebParser to parse sites that require a logon to access the information, as WebParser has no idea how to logon or use cookies. You can't parse a site that uses client-side Javascript, as WebParser has no idea what Javascript is, and makes no attempt to execute it.
You need to find a resource that you can get at for this information if there is one, or perhaps it is time to explore that Lua solution.
-
- Posts: 75
- Joined: December 15th, 2018, 3:35 am
Re: MoonCalc Infos
Thanks again for the objectivity.
It's ... I was thinking of looking for feeds with this information.
Well ... without being able to use information from websites in our Skins we have only one option left, which I try to avoid:
Pray for the gods of the feeds will proliferate while locally calculating my information with scripts .lua!
-
- Posts: 75
- Joined: December 15th, 2018, 3:35 am
Re: MoonCalc Infos
WebParser can not extract information from this file here ?jsmorley wrote: ↑February 27th, 2019, 12:44 am I'm not trying to rain on your parade, I just am trying to describe what Rainmeter can and can't do. You can't use WebParser to parse sites that require a logon to access the information, as WebParser has no idea how to logon or use cookies. You can't parse a site that uses client-side Javascript, as WebParser has no idea what Javascript is, and makes no attempt to execute it.
You need to find a resource that you can get at for this information if there is one, or perhaps it is time to explore that Lua solution.
-
- Rainmeter Sage
- Posts: 16177
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: MoonCalc Infos
Probably it can, but that file is saved by you from Chrome (I suppose). Later, when the content of the site changes, how will you get the new file? Will you save it every day, then use Rainmeter to get the information? I doubt...
Believe jsmorley and me: there is no way to use Rainmeter to capture the needed information from that site. Try to find another one, which doesn't use java scripts to show up the information, or alternatively take into account to use a lua script file, to make the needed calculation, as suggested. It's not so hard as you're affraid of it.
-
- Posts: 75
- Joined: December 15th, 2018, 3:35 am
Re: MoonCalc Infos
I thought of using in Rainmeter (with UpdateRate) a small script to open the website in the Browser (Chrome) and save in SDD and then use WebParser in the saved file.balala wrote: ↑February 27th, 2019, 8:52 am Probably it can, but that file is saved by you from Chrome (I suppose). Later, when the content of the site changes, how will you get the new file? Will you save it every day, then use Rainmeter to get the information? I doubt...
Believe jsmorley and me: there is no way to use Rainmeter to capture the needed information from that site. Try to find another one, which doesn't use java scripts to show up the information, or alternatively take into account to use a lua script file, to make the needed calculation, as suggested. It's not so hard as you're affraid of it.
Someone who is good at .lua (or another) could write this little script.
This would open a way for all of us Rainmeter users to be able to use information from a much larger number of websites and information!
Is not that easy? That's not possible?
I believe you, thought that maybe I did not explain well.
All your suggestions (Find a feed, find another website, use .lua, another SW to get the saved file for WebParser) will be useful and used by me and us.
-
- Rainmeter Sage
- Posts: 16177
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: MoonCalc Infos
I think it's nor easy, nor possible, if I can say so. How would you open the browser, load the site and finally save it? I don't see this as an affordable way. Sorry...GTI.H wrote: ↑February 27th, 2019, 3:51 pm I thought of using in Rainmeter (with UpdateRate) a small script to open the website in the Browser (Chrome) and save in SDD and then use WebParser in the saved file.
Someone who is good at .lua (or another) could write this little script.
This would open a way for all of us Rainmeter users to be able to use information from a much larger number of websites and information!
Is not that easy? That's not possible?
-
- Posts: 75
- Joined: December 15th, 2018, 3:35 am
Re: MoonCalc Infos
These are responses like this that make me think that I'm not explaining well.
Open, and save are particular problems of each scripting language.
Simple example:
start Chrome.exe -new-tab www.mooncalc.org/#/48.8583,2.2945,17/2015.05.11/13:15/324.0/1
or
cmd /c start -new-tab Chrome.exe www.mooncalc.org/#/48.8583,2.2945,17/2015.05.11/13:15/324.0/1
at the command prompt opens the website, you can also open it with Rainmeter.
Now the next steps would be, open hidden and save or access the browser cache of this website.
-
- Posts: 75
- Joined: December 15th, 2018, 3:35 am
Re: MoonCalc Infos
Sorry for the delay, according to you, it was a difficult problem.
Here is a simple PowerShell script Download_WebSite.ps1 that puts the necessary information in the SSD:
Code: Select all
$ie = new-object -ComObject "InternetExplorer.Application"
$url = "https://www.mooncalc.org/#/48.8583,2.2945,17/2019.02.27/20:18/324.0/1"
$ie.silent = $true
$ie.navigate($url)
while($ie.Busy) { Start-Sleep -Milliseconds 100 }
Start-Sleep 3
$ie.Document.documentElement.innerHTML > "$PSScriptRoot\output.html"
$ie.Stop()
$ie.Quit()
You do not have the required permissions to view the files attached to this post.
Last edited by GTI.H on February 28th, 2019, 3:46 am, edited 1 time in total.
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: MoonCalc Infos
This RegExp will return the StringIndexes shown below as long as the site HTML does not change.
Returned StringIndexes:
1 => 02:55:58 || Moon Rise
2 => 07:30:46 || Moon Culmination
3 => 12:01:09 || Moon Set
4 => 396483km || Moon Distance
5 => -61.83° || Moon Altitude
6 => 10.55° || Moon Azimuth
7 => Waning Crescent/37.0% || Moon Phase
8 => 22.93 von 29.79 Tagen || Moon Age
9 => 06.03.2019 17:03:32 || Next New Moon
10 => 21.03.2019 02:42:19 || Next Full Moon
11 => N 48°51'29.87'' || Lat
12 => 48.85830° || Lat Degrees
13 => E 2°17'40.2'' || Lng
14 => 2.29450° || Lng Degrees
The only other data is a list of eclipses starting in 2001, but that contains 20+ values for each eclipse and trying to capture just the first few would exceed the limit of 99 indexes for a single parse. This could be done using a separate measure and perhaps StringIndex2 method.
Code: Select all
RegExp=(?siU).*>Moon Rise:<.*<td>.*>(.*)<.*>Moon Culmination:<.*<td>.*>(.*)<.*>Moon Set:<.*<td>.*>(.*)<.*>Moon Distance:<.*<td>.*>(.*)<.*>Moon Altitude:<.*<td>.*>(.*)<.*>Moon Azimuth:<.*<td>.*>(.*)<.*<acronym>.*"Moon Phase".*class=.*>(.*)<.*<acronym>.*"Moon Age".*class=.*>(.*)<.*<acronym>.*"Next New Moon".*class=.*>(.*)<.*<acronym>.*"Next Full Moon".*class=.*>(.*)<.*>Lat:<.*<td.*<span.*>(.*)<.*<span.*>(.*)<.*>Lng:<.*<td.*<span.*>(.*)<.*<span.*>(.*)<.*
1 => 02:55:58 || Moon Rise
2 => 07:30:46 || Moon Culmination
3 => 12:01:09 || Moon Set
4 => 396483km || Moon Distance
5 => -61.83° || Moon Altitude
6 => 10.55° || Moon Azimuth
7 => Waning Crescent/37.0% || Moon Phase
8 => 22.93 von 29.79 Tagen || Moon Age
9 => 06.03.2019 17:03:32 || Next New Moon
10 => 21.03.2019 02:42:19 || Next Full Moon
11 => N 48°51'29.87'' || Lat
12 => 48.85830° || Lat Degrees
13 => E 2°17'40.2'' || Lng
14 => 2.29450° || Lng Degrees
The only other data is a list of eclipses starting in 2001, but that contains 20+ values for each eclipse and trying to capture just the first few would exceed the limit of 99 indexes for a single parse. This could be done using a separate measure and perhaps StringIndex2 method.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::