Quantcast
Viewing all articles
Browse latest Browse all 1112

Help: Rainmeter Skins • Re: Problem with YouTube Subs Counter

thanks, i think it works perfectly.
You're welcome, I'm glad if it does. Image may be NSFW.
Clik here to view.
;-)

I put a Substitute="18":"CurrSubs" in the "Subscribers" string so it doesnt show 18 again.
Yeah, I don't think that's a solution to avoid the measure matching the wrong number. CurrSubs is just a string, [CurrSubs] is the value of the that measure, but in any case it doesn't make much sense to do it. If the format of the response received in WebParserDump.txt alternates for you too like mentioned earlier, try this:

Code:

[Variables]PrevSubs=0[Rainmeter]Update=1000AccurateText=1DynamicWindowSize=1BackgroundMode=2SolidColor=0,0,0,255[StatsSubs]Measure=WebParserURL=https://www.youtube.com/dasiun;URL=file://#CURRENTPATH#WebParserDump.txtUserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36Flags=ForceReload | NoCookiesRegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")StringIndex=1UpdateRate=3600Debug=2FinishAction=[!EnableMeasure CurrSubs][!UpdateMeasure CurrSubs][CurrSubs]Disabled=1Measure=CalcFormula=[&StatsSubs]UpdateDivider=-1IfCondition=(#CURRENTSECTION#<#PrevSubs#)IfTrueAction=[!SetVariable PrevSubs [CurrSubs]][!WriteKeyValue Variables PrevSubs [CurrSubs]][!SetOption Subscribers FontColor "255,0,0,255"][!UpdateMeter Subscribers][!Redraw]IfCondition2=(#CURRENTSECTION#>#PrevSubs#)IfTrueAction2=[!SetVariable PrevSubs [CurrSubs]][!WriteKeyValue Variables PrevSubs [CurrSubs]][!SetOption Subscribers FontColor "0,255,0,255"][!UpdateMeter Subscribers][!Redraw];IfCondition3=(#CURRENTSECTION#=#PrevSubs#);IfTrueAction3=[!SetVariable PrevSubs [CurrSubs]][!WriteKeyValue Variables PrevSubs [CurrSubs]][!SetOption Subscribers FontColor "255,255,255,255"][!UpdateMeter Subscribers][!Redraw]DynamicVariables=1[Subscribers]Meter=StringMeasureName=StatsSubsStringAlign=LeftY=0X=0FontSize=37FontColor=255,255,255,255AntiAlias=1Text=Subs: %1
I used a "branch reset group" here as the RegExp pattern, which basically tries to match the part before the | and do the number capture, and if it fails it tries to match the part after the | and do the number capture. The | symbol means "OR".

I also left the equality test commented out in case you need that behavior. Assuming the last subs before loading the skin was 363 and you have a progression of subs like 363, 364, 364 on subsequent measure updates after loading the skin:
- if uncommented the text will be white (363=363), green (364>363), and then white again (364=364) until an increase or decrease occurs
- if commented the text will be white (default), green (364>363), and then still green (no action) until an increase or decrease occurs
In other words, when uncommented the color is strictly based on the comparison to the previous value so white will occur as soon as they are equal, while when commented the color will stay true to the green or red "trend" last registered even though the current value might be equal to the last value from one update to another.

Statistics: Posted by Yincognito — Today, 3:23 am



Viewing all articles
Browse latest Browse all 1112

Trending Articles