It is currently October 9th, 2024, 7:31 pm

COVID-19 Statbar

RSS, ATOM and other feeds, GMail, Stocks, any information retrieved from the internet
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: COVID-19 Statbar

Post by ms310 »

mak_kawa wrote: April 20th, 2020, 2:31 am As ms310 said, nCov2019.live is now back and with changed HTML structure. So, need to modify RegExp...
I don't have time to fully put this into the skin at the moment but I did play around with RainRegExp and came up with the following:

Code: Select all

RegExp=(?siU)<span class="legend-label confirmed">(.*)</span>.*<span class="legend-label critical">(.*)</span>.*<span class="legend-label deceased">(.*)</span>.*<span class="legend-label recovered">(.*)</span>.*
Here are the StringIndex values:
1: Total Cases
2: Total Critical
3: Total Deceased
4: Total Recovered

I didn't bother with "updated" - this site is constantly updated and you will notice that value always says "a few seconds ago".

I hope this helps.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: COVID-19 Statbar

Post by mak_kawa »

Hi balala

Yes, they (=web site designers) never care about Rainmeter Webparser parsing. And do what they want...:-)
User avatar
balala
Rainmeter Sage
Posts: 16645
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: COVID-19 Statbar

Post by balala »

mak_kawa wrote: April 20th, 2020, 9:11 am Yes, they (=web site designers) never care about Rainmeter Webparser parsing. And do what they want...:-)
I think at least in some cases they are changing the source code of the sites exactly to avoid such tools like Rainmeter to parse their sites. I'm not sure, but have this feeling.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: COVID-19 Statbar

Post by mak_kawa »

HTML structure of the nCoV2019.live seems to be changed this morning. I must modify my RegExp again (and again?)...:-)
Now think seriously I have to be back to the worldometer...
User avatar
balala
Rainmeter Sage
Posts: 16645
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: COVID-19 Statbar

Post by balala »

mak_kawa wrote: April 23rd, 2020, 12:06 pm HTML structure of the nCoV2019.live seems to be changed this morning. I must modify my RegExp again (and again?)...:-)
Yes, again and again: https://forum.rainmeter.net/viewtopic.php?p=175051#p174828
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: COVID-19 Statbar

Post by mak_kawa »

Hi balala

Owner/developer(?) of the nCov2019.live site is a motivated highschool boy, and he always modifying the HTML to improve his COVID-19 site. Very good.

But it bothers me that my RegExp description is frequently broken. It's a dark side of the web-scraping. Maybe there would be a smart RegExp method (lookahead assertion??) to adapt to such changing HTML, but I don't know. And if such a method exists, I can't use/handle it with my skill...

I must live with it as a Rainmeter noob. :-)
User avatar
balala
Rainmeter Sage
Posts: 16645
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: COVID-19 Statbar

Post by balala »

mak_kawa wrote: April 23rd, 2020, 8:28 pm Maybe there would be a smart RegExp method (lookahead assertion??) to adapt to such changing HTML, but I don't know. And if such a method exists, I can't use/handle it with my skill...
Don't know, didn't take a look yet, but I doubt there is. Lookahead Assertion is used when on the site should be some occurrences of a string, but you don't know how many or if they even are there. But when the HTML code changes, usually Lookahead Assertion doesn't help.
Right now I'm not working anymore for today, but maybe tomorrow will try to figure out something. But I don't promis anything. Sorry...
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: COVID-19 Statbar

Post by mak_kawa »

Hi balala

Thank you for clarification about the lookahead assertion.

Perhaps, I can make solution using RegExpSubstitution which follows such "changing HTML". I am not confident, but will try.
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: COVID-19 Statbar

Post by ms310 »

dvo wrote: April 24th, 2020, 10:02 am i switched to a other site ...works till now very good :) :Whistle
Which? Thanks!
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: COVID-19 Statbar

Post by mak_kawa »

I too want to know the site!, dvo.