Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1407

Help: Rainmeter Skins • Re: random rss feed every...

$
0
0
hello, I believe I am very close, but missing something small... what I want is every X seconds/minutes display random RSS feed (StringIndex 1 to 10)
thx
Indeed, you're very close, but you're missing a couple of small things:
- your current Formula starts from 1, but subsequent restarts will be from 0 given its form (e.g. ((9 + 1 ) %10 ) = 0 and so on), see the adjustment below
- your 1st OnUpdateAction additionally needs this to trigger [Feed], while your 2nd OnUpdateAction should be this for a WebParser parent measure since the update time in such a case is not the same with the time the online retrieval is complete
- your StringIndex values need a little adjustment, because currently they must increase by 2 (i.e. the title and the link, aka FeedEntries) and not just by 1
- although in practice they're sometimes unnecessary, it's better to enclose paths or links between quotes, e.g. in your LeftMouseUpAction
- as always, enabling dynamic variables via DynamicVariables=1 in key places is an easy to overlook detail that can make your skin work

So, given the above, your code should be something like (compare the differences):

Code:

[Rainmeter]Update=1000AccurateText=1DynamicWindowSize=1; --- [RndNo]Measure=CalcFormula=(RndNo % 10 + 1)UpdateDivider=60OnUpdateAction=[!SetVariable FeedNo "[RndNo]"][!CommandMeasure Feed "Update"]DynamicVariables=1; --- [Variables]itm=.*<item.*>.*<title>(.*)</title>.*<link>(.*)</link>.*FeedNo=1FeedEntries=2; --- [Feed]Measure=WebParserUrl="https://news.google.com/rss"RegExp="(?siU)#itm##itm##itm##itm##itm##itm##itm##itm##itm##itm#"FinishAction=[!UpdateMeter *][!Redraw]; --- RSS1 [MeasureT]Measure=WebParserUrl=[Feed]StringIndex=((#FeedNo# - 1) * #FeedEntries# + 1)DynamicVariables=1[MeasureL]Measure=WebParserURL=[Feed]StringIndex=((#FeedNo# - 1) * #FeedEntries# + 2)DynamicVariables=1[Meter]Meter=STRINGMeasureName=MeasureTX=0Y=0W=500SolidColor=0,0,0,1FontColor=255, 255, 255FontSize=10ClipString=1DynamicVariables=1AntiAlias=1LeftMouseUpAction=["[MeasureL]"]Text="_%1"; --- 
That being said, because of this, you need to keep polling the site every minute when you change the [RndNo] (which, by the way, isn't random, but sequential in nature). For reasonable polling intervals (controlled by the [RndNo]'s UpdateDivider in this case), this shouldn't be an issue, but it might worth considering getting all StringIndexes in child measures on a less frequent basis, and simply change the measure index you reference in the meter instead of changing the StringIndexes themselves (which requires re-accessing the web resource, as explained in the manual). More copy pasting, less chances of being blocked / banned by the site.

Statistics: Posted by Yincognito — Yesterday, 4:29 pm



Viewing all articles
Browse latest Browse all 1407

Trending Articles