Hi all...been a while. I used to lurk here a lot more back in the day but unfortuately life really went downhill since 2017 and to cut a long story short, I went to hell and back.
Luckily I'm on the mend again and I'm slowly returning to things that I used to fondly spend time doing all those years ago. So I decided to give a few of my unfinished skins a go and felt like finishing one off, sort of inspired by the android designs over the years.
Before I post it in the skins section, any idea why this webparser isn't working?
Everything works apart from the measureWAN measure. It doesn't parse the html code and I can't figure out why...given that I've given rainmeter a break for around 6 years it could be something fundamental that I've forgotten, but after a couple of hours online I can't seem to diagnose the issue.
DanielPodo wrote: ↑January 22nd, 2024, 11:29 pm
Hi all...been a while. I used to lurk here a lot more back in the day but unfortuately life really went downhill since 2017 and to cut a long story short, I went to hell and back.
Luckily I'm on the mend again and I'm slowly returning to things that I used to fondly spend time doing all those years ago. So I decided to give a few of my unfinished skins a go and felt like finishing one off, sort of inspired by the android designs over the years.
Before I post it in the skins section, any idea why this webparser isn't working?
Everything works apart from the measureWAN measure. It doesn't parse the html code and I can't figure out why...given that I've given rainmeter a break for around 6 years it could be something fundamental that I've forgotten, but after a couple of hours online I can't seem to diagnose the issue.
Nice to see you're back on form.
You might want to:
- check if the site still works
- check if the regex pattern is appropriate
- precede regex reserved chars like / with a \ to escape them
Other than that, the code looks fine, though I didn't test it. One more thing: it makes no sense to update anything before refreshing, since the latter already does that.
Yincognito wrote: ↑January 23rd, 2024, 1:27 pm
Nice to see you're back on form.
You might want to:
- check if the site still works
- check if the regex pattern is appropriate
- precede regex reserved chars like / with a \ to escape them
Other than that, the code looks fine, though I didn't test it. One more thing: it makes no sense to update anything before refreshing, since the latter already does that.
> check if the site still works
It does.
> check if the regex pattern is appropriate
According to https://regex101.com/, yes it does (though it told me to escape the slash in the closing span bracket but still, even with that fixed, nothing works.
> precede regex reserved chars like / with a \ to escape them
As above.
> One more thing: it makes no sense to update anything before refreshing, since the latter already does that.
DanielPodo wrote: ↑January 23rd, 2024, 1:49 pm
> check if the site still works
It does.
> check if the regex pattern is appropriate
According to https://regex101.com/, yes it does (though it told me to escape the slash in the closing span bracket but still, even with that fixed, nothing works.
> precede regex reserved chars like / with a \ to escape them
As above.
> One more thing: it makes no sense to update anything before refreshing, since the latter already does that.
Ah, thanks!
Alright, thanks for letting us know. I'll test the code in a couple of moments to see what can be done about it.
Yincognito wrote: ↑January 23rd, 2024, 1:53 pm
Alright, thanks for letting us know. I'll test the code in a couple of moments to see what can be done about it.
If it helps, I checked the rainmeter log and it says "RegExp matching error (-1)".
From my tests it appears 'whatismyip.com' is using java scripts to show your address, and does not contain the IP address TEXT anywhere the Webparser can access...
I tried a different site : 'showmyip.com' and changed the RegExp. With this site I was able to parse the IP address.
Try this modified measure and see if it works for you.
Just to confirm, eclectic-tech is right, the IPs provided by the site you were using are hidden behind their corresponding Javascript retrieval functions, so you won't be able to get them by parsing the page source. Changing the site is the best option, unless you want to register and get 24 free calls per day as per their API, which will provide data in a Javascript free text form that can be retrieved by WebParser: https://www.whatismyip.com/api/
Obviously, 24 calls per day could be insufficient and most likely not suited unless you're looking for rare, personal usage of these features.
I tried a few websites like the one I was using and I guess they all use JS to generate the IP, causing the issue as I originally described.
Try this modified measure and see if it works for you.
Thanks! That works!
While I'm at it, my old weather skin isn't working either, I'm guessing the same issue (plus it's been 4-5 years since I last used the skin). Is there a website you guys can recommend?