It is currently September 23rd, 2020, 12:14 pm

Weather Skins Not Working

Help with creating, editing & fixing problems with skins
User avatar
Brian
Developer
Posts: 2062
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Weather Skins Not Working

Post by Brian »

For now, this is just an option for Webparser. It will decode unicode code points like \uXXXX and \UXXXXXXXX (although the former is used most often). This doesn't do octal code points.

I am not sure there is a huge need for this outside of Webparser. We already have character variables that work in the same way.

There may some need to have it work with features that can read other files like the quote plugin and lua, but we haven't made any decisions about that yet.

-Brian
User avatar
jsmorley
Developer
Posts: 21386
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working - This is the only allowed thread about this

Post by jsmorley »

Yincognito wrote: August 1st, 2020, 11:43 pm Yeah, anywhere you put it, as long as it works, personally I do want it. As I said, it's not just weather.com which does have these "code points", but other sites as well. Apart from that, while the API JSON is indeed the most convenient solution, I wouldn't like to be restricted (again) to just one single way of getting the data. Having at least two alternatives (the API JSON and the main site's one) is safer, in my view. Look how useful the API JSON alternative proved to be now.

Or, if you changed you mind, let me know so I can deal with the substitutions myself. :D
Done... The beta with this new option is out.
User avatar
Yincognito
Posts: 2587
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

Brian wrote: August 2nd, 2020, 12:11 am For now, this is just an option for Webparser. It will decode unicode code points like \uXXXX and \UXXXXXXXX (although the former is used most often). This doesn't do octal code points.

I am not sure there is a huge need for this outside of Webparser. We already have character variables that work in the same way.

There may some need to have it work with features that can read other files like the quote plugin and lua, but we haven't made any decisions about that yet.

-Brian
Looks good to me. Regarding the Quote plugin, I'm no expert in it, but isn't a part of the plugin functionality (i.e. reading random lines from a file) able to be replicated by using a Calc measure and a WebParser measure parsing a local file anyway? Assuming there are \uXXXX code points in that file, that is.
User avatar
jsmorley
Developer
Posts: 21386
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

Yincognito wrote: August 2nd, 2020, 12:43 am Looks good to me. Regarding the Quote plugin, I'm no expert in it, but isn't a part of the plugin functionality (i.e. reading random lines from a file) able to be replicated by using a Calc measure and a WebParser measure parsing a local file anyway? Assuming there are \uXXXX code points in that file, that is.
Note that this supports "normalization" of Unicode code points as well.

https://flaviocopes.com/unicode/#normalization

So the string \uD834\uDF06 would decode to 𝌆

P.S. This also works with Character Variables in Rainmeter.
User avatar
raiguard
Posts: 667
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Weather Skins Not Working

Post by raiguard »

Just wanna pop in and say, I'm really impressed by the level of commitment everyone has for this. I'm not the best at being patient and I probably would have just given up at this point. But no, jsmorley and co. just keep pressing on! Great job guys/gals, you're all amazing.

Maybe I'll actually finally update my Weather Meter soon... hopefully. ;-)
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
jsmorley
Developer
Posts: 21386
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

Just to follow up...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
MyString=\uD834\uDF06

[MeasureReadStringFromFile]
Measure=WebParser
URL=file://#CURRENTPATH##CURRENTFILE#
CodePage=1200
RegExp=(?siU)MyString=(.*)\r\n
StringIndex=1
DecodeCodePoints=1

[MeterDisplay]
Meter=String
MeasureName=MeasureReadStringFromFile
FontSize=25
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Look, I found a %1, which is the same as [\xD834][\xDF06]

1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Posts: 2587
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working - This is the only allowed thread about this

Post by Yincognito »

jsmorley wrote: August 2nd, 2020, 12:35 am Done... The beta with this new option is out.
Brilliant - it works flawlessly! I don't think I expected a feature so eagerly before, LOL - must have been the first one downloading the new beta. Just one thing though...if I'm applying this to an "itermediate" WebParser child (which also does some regexp substitutions; my bad, it doesn't actually), it doesn't work, I have to apply it on the "final" WebParser child (aka the grandchild). Don't bother with the variables below, they are just normal strings, the idea is important.
The parent:

Code: Select all

[MS_WebParser_Weather]
Measure=WebParser
Url="#WeatherURL#"
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
RegExp=#Flag##Weather#
UpdateRate=(#DetectionUpdateDivider#*#UpdateInterval#/#SlidingUpdate#)
FinishAction=[!SetVariable MomentIndex -1][!UpdateMeasureGroup "WeatherGroup"][!UpdateMeasureGroup "WeatherDerivativeGroup"][!UpdateMeasureGroup "MomentGroup"][!SetOption MT_Rainmeter_ForecastDayPartTopic StringAlign "Left"][!SetOption MT_Rainmeter_ForecastDayPartTopic X (#ContainerWidth#)][!SetOption MT_Rainmeter_ForecastDayPartTopic Text "#ForecastDayPartTopicText#"][!UpdateMeter *][!EnableMeasure "MS_Rainmeter_Counter"][!EnableMouseActionGroup "MouseOverAction|MouseLeaveAction|MouseScrollUpAction|MouseScrollDownAction|LeftMouseUpAction|MiddleMouseUpAction|RightMouseUpAction" MouseActionsGroup][!Redraw]
OnConnectErrorAction=[!SetVariable MomentIndex -1][!UpdateMeasureGroup "WeatherGroup"][!UpdateMeasureGroup "WeatherDerivativeGroup"][!UpdateMeasureGroup "MomentGroup"][!SetOption MT_Rainmeter_ForecastDayPartTopic StringAlign "Left"][!SetOption MT_Rainmeter_ForecastDayPartTopic X (#ContainerWidth#)][!SetOption MT_Rainmeter_ForecastDayPartTopic Text "#ForecastDayPartTopicText#"][!UpdateMeter *][!EnableMeasure "MS_Rainmeter_Counter"][!EnableMouseActionGroup "MouseOverAction|MouseLeaveAction|MouseScrollUpAction|MouseScrollDownAction|LeftMouseUpAction|MiddleMouseUpAction|RightMouseUpAction" MouseActionsGroup][!Redraw]
OnRegExpErrorAction=[!SetVariable MomentIndex -1][!UpdateMeasureGroup "WeatherGroup"][!UpdateMeasureGroup "WeatherDerivativeGroup"][!UpdateMeasureGroup "MomentGroup"][!SetOption MT_Rainmeter_ForecastDayPartTopic StringAlign "Left"][!SetOption MT_Rainmeter_ForecastDayPartTopic X (#ContainerWidth#)][!SetOption MT_Rainmeter_ForecastDayPartTopic Text "#ForecastDayPartTopicText#"][!UpdateMeter *][!EnableMeasure "MS_Rainmeter_Counter"][!EnableMouseActionGroup "MouseOverAction|MouseLeaveAction|MouseScrollUpAction|MouseScrollDownAction|LeftMouseUpAction|MiddleMouseUpAction|RightMouseUpAction" MouseActionsGroup][!Redraw]
DynamicVariables=1
The "itermediate" child:

Code: Select all

[MS_WebParser_Weather_Location]
Group=WeatherGroup
Measure=WebParser
Url=[MS_WebParser_Weather]
StringIndex=1
RegExp=#Flag##Location#
StringIndex2=1
DecodeCodePoints=1
UpdateDivider=-1
The "final" child:

Code: Select all

[MS_WebParser_Weather_Location_District]
Group=WeatherGroup
Measure=WebParser
Url=[MS_WebParser_Weather_Location]
StringIndex=1
RegExp=#Flag##District#(#Data#)#Stop#
StringIndex2=1
UpdateDivider=-1
DecodeCodePoints=1
RegExpSubstitute=1
Substitute="#Decoder#","(?:^\s+|\s+$)":"",'(?:^"|"$)':"","(?i)(?:^$|^N\/A$|^null$)":"No District"
So, if I comment out the option in [MS_WebParser_Weather_Location_District], it doesn't produce the desired effect. I'm probably missing something here, or it's indeed the expected behavior. I was thinking that I could apply this options to just my 4 "intermediate" WebParser children (i.e. Location, Observation, DateTime and DailyForecast), without bothering adding the option to the more than 4 "final" children.
jsmorley wrote: August 2nd, 2020, 12:55 amNote that this supports "normalization" of Unicode code points as well.

https://flaviocopes.com/unicode/#normalization

So the string \uD834\uDF06 would decode to 𝌆

P.S. This also works with Character Variables in Rainmeter.
Wow, that's great news. Thank You! :rosegift:
User avatar
jsmorley
Developer
Posts: 21386
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

I'm not sure. I think Brian would need to weigh in on whether or not a StringIndex2 option in fact creates a "child" measure in the eyes of WebParser. I would also be a bit concerned about how the UpdateDivider=-1 is being handled in this case. Don't forget that WebParser "parent" functionality depends on UpdateRate or [!CommandMeasure MeasureName "Update"].
User avatar
Yincognito
Posts: 2587
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

jsmorley wrote: August 2nd, 2020, 1:10 am I'm not sure. I think Brian would need to weigh in on whether or not a StringIndex2 option in fact creates a "child" measure in the eyes of WebParser. I suspect not...
I see... :???: I'm curious what Brian has to say about this. Just a follow up question: you are able to replicate it, aren't you?
jsmorley wrote: August 2nd, 2020, 1:10 amI would also be a bit concerned about how the UpdateDivider=-1 is being handled in this case. Don't forget that WebParser "parent" functionality depends on UpdateRate or [!CommandMeasure MeasureName "Update"].
Yeah, but I do update the group those measures belong to in the FinishAction of the WebParser parent... :confused:
Last edited by Yincognito on August 2nd, 2020, 1:21 am, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 21386
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

Yincognito wrote: August 2nd, 2020, 1:19 am I see... :???: I'm curious what Brian has to say about this. Just a follow up question: you are able to replicate it, aren't you?
LOL, There is no way I'm even going to attempt to figure out that mess you have going... ;-)