It is currently April 18th, 2024, 2:29 pm

Dynamic Quotes

Get help with creating, editing & fixing problems with skins
ZStud
Posts: 8
Joined: November 14th, 2022, 4:49 pm

Dynamic Quotes

Post by ZStud »

I have a quote of the day skin, and I can't seem, to figure out how to make it dynamic. I've tried to look it up, tried to change some things myself, but can't find a tutorial that can help. I was hoping someone here would know how and could help me out.
Big Space.PNG
Here, the space is much too big between the quote and the author.
No Space.PNG
Here, the quote is clipping into the author and I can't even see the whole thing, as it's too big. I just want it to size itself according to how big the quote is, while maintaining the same space between author and quote.

Here's the skin.

Code: Select all

[Rainmeter] 
Update=1000 
Author=Noridomi BimBim 
Mail=noridomi.bimbim@gmail.com

[Metadata] 
Name=Quotes
Config=
Description=Change your quotes everyday !!!
Instructions=
Version=1.00 
Tags=RSS | Quotes
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0 
Preview= 
Variant= 
;End of added Metadata 

[Variables] 
TextColor=255,255,255,160
LabelColor=255,255,255,90
LineHeight=69
RSS=http://www.quotationspage.com/data/qotd.rss 
Substitute="":"...","&amp;":"&","&quot;":"'","<![CDATA[":"","]]>":"" 

[MeasureAuthor] 
Measure=Plugin 
Plugin=Plugins\WebParser.dll 
URL=http://www.quotationspage.com/data/qotd.rss
RegExp="(?siU)<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>" 
Substitute=#Substitute# 
StringIndex=3

[MeasureQuote] 
Measure=Plugin 
Plugin=Plugins\WebParser.dll 
URL=http://www.quotationspage.com/data/qotd.rss
RegExp="(?siU)<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>" 
Substitute=#Substitute# 
StringIndex=3

[MeasureTime] 
Measure=Plugin 
Plugin=Plugins\WebParser.dll 
URL=http://www.quotationspage.com/data/qotd.rss
RegExp="(?siU)<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>" 
Substitute=#Substitute# 
StringIndex=3

[MeterAuthor] 
Meter=String 
MeasureName=MeasureAuthor
X=50 
Y=130 
W=400 
H=#LineHeight# 
ClipString=1 
FontColor=#TextColor#
FontFace=Aquatico
FontSize=17
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
MouseOverAction=!Execute [!RainmeterShowMeter MeterHover1][!RainmeterRedraw] MouseLeaveAction=!Execute [!RainmeterHideMeter MeterHover1][!RainmeterRedraw] LeftMouseDownAction=[MeasureRSS1Link] 

[MeterQuote] 
Meter=String 
MeasureName=MeasureQuote
X=5 
Y=40
W=950
H=100
ClipString=1 
FontColor=#TextColor#
FontFace=Aquatico
FontSize=21
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
MouseOverAction=!Execute [!RainmeterShowMeter MeterHover1][!RainmeterRedraw] MouseLeaveAction=!Execute [!RainmeterHideMeter MeterHover1][!RainmeterRedraw] LeftMouseDownAction=[MeasureRSS1Link] 
Thanks in advance!
You do not have the required permissions to view the files attached to this post.
User avatar
Jeff
Posts: 327
Joined: September 3rd, 2018, 11:18 am

Re: Dynamic Quotes

Post by Jeff »

Move the whole [MeterAuthor] section after [MeterQuote], after that, change the Y on [MeterAuthor] to Y=90R
Read about relative positioning here https://docs.rainmeter.net/manual/meters/general-options/#XY
ZStud
Posts: 8
Joined: November 14th, 2022, 4:49 pm

Re: Dynamic Quotes

Post by ZStud »

Jeff wrote: December 26th, 2022, 6:38 pm Move the whole [MeterAuthor] section after [MeterQuote], after that, change the Y on [MeterAuthor] to Y=90R
Read about relative positioning here https://docs.rainmeter.net/manual/meters/general-options/#XY
Hey, so this did fix my issue of the quote clipping into the author, so thank you for that! But I did have to change the 90R to 20R because the space between the author and quote were too big. And now that the quote is small again, there is a big space between the quote and the author. It's because I had to up the width a lot to fix the cut-off, but now it counts as a huge space between the quote and the author. How could I make this change on each quote as well? Thanks!
Capture.PNG
Updated Code:

Code: Select all

[Rainmeter] 
Update=1000 
Author=Noridomi BimBim 
Mail=noridomi.bimbim@gmail.com

[Metadata] 
Name=Quotes
Config=
Description=Change your quotes everyday !!!
Instructions=
Version=1.00 
Tags=RSS | Quotes
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0 
Preview= 
Variant= 
;End of added Metadata 

[Variables] 
TextColor=255,255,255,160
LabelColor=255,255,255,90
LineHeight=69
RSS=http://www.quotationspage.com/data/qotd.rss 
Substitute="":"...","&amp;":"&","&quot;":"'","<![CDATA[":"","]]>":"" 

[MeasureAuthor] 
Measure=Plugin 
Plugin=Plugins\WebParser.dll 
URL=http://www.quotationspage.com/data/qotd.rss
RegExp="(?siU)<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>" 
Substitute=#Substitute# 
StringIndex=3

[MeasureQuote] 
Measure=Plugin 
Plugin=Plugins\WebParser.dll 
URL=http://www.quotationspage.com/data/qotd.rss
RegExp="(?siU)<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>.*<item>.*<description>(.*)</description>.*<link>(.*)</link>" 
Substitute=#Substitute# 
StringIndex=3

[MeasureTime] 
Measure=Plugin 
Plugin=Plugins\WebParser.dll 
URL=http://www.quotationspage.com/data/qotd.rss
RegExp="(?siU)<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>" 
Substitute=#Substitute# 
StringIndex=3

[MeterQuote] 
Meter=String 
MeasureName=MeasureQuote
X=5 
Y=40
W=950
H=200
ClipString=1 
FontColor=#TextColor#
FontFace=Aquatico
FontSize=20
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
MouseOverAction=!Execute [!RainmeterShowMeter MeterHover1][!RainmeterRedraw] MouseLeaveAction=!Execute [!RainmeterHideMeter MeterHover1][!RainmeterRedraw] LeftMouseDownAction=[MeasureRSS1Link] 

[MeterAuthor] 
Meter=String 
MeasureName=MeasureAuthor
X=50 
Y=20R 
W=400 
H=#LineHeight# 
ClipString=1 
FontColor=#TextColor#
FontFace=Aquatico
FontSize=17
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
MouseOverAction=!Execute [!RainmeterShowMeter MeterHover1][!RainmeterRedraw] MouseLeaveAction=!Execute [!RainmeterHideMeter MeterHover1][!RainmeterRedraw] LeftMouseDownAction=[MeasureRSS1Link] 
You do not have the required permissions to view the files attached to this post.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2603
Joined: March 23rd, 2015, 5:26 pm

Re: Dynamic Quotes

Post by SilverAzide »

ZStud wrote: December 27th, 2022, 5:35 pm Hey, so this did fix my issue of the quote clipping into the author, so thank you for that! But I did have to change the 90R to 20R because the space between the author and quote were too big. And now that the quote is small again, there is a big space between the quote and the author. It's because I had to up the width a lot to fix the cut-off, but now it counts as a huge space between the quote and the author. How could I make this change on each quote as well? Thanks!
Trying getting rid of the height (H=200) on the [MeterQuote] meter. Since you are using ClipString to wrap text, let Rainmeter decide on the height the meter needs to be. Since you are using relative positioning (Y=20R) on the [MeterAuthor] meter, it will (should) be positioned 20 pixels below the bottom of the [MeterQuote] meter no matter how tall the quote ends up being.

Also, when you have time, get rid of all the !Execute bangs and fix the !Rainmeter... bangs. All that stuff has been obsolete for like a decade.
Gadgets Wiki GitHub More Gadgets...
ZStud
Posts: 8
Joined: November 14th, 2022, 4:49 pm

Re: Dynamic Quotes

Post by ZStud »

SilverAzide wrote: December 27th, 2022, 9:12 pm
Trying getting rid of the height (H=200) on the [MeterQuote] meter. Since you are using ClipString to wrap text, let Rainmeter decide on the height the meter needs to be. Since you are using relative positioning (Y=20R) on the [MeterAuthor] meter, it will (should) be positioned 20 pixels below the bottom of the [MeterQuote] meter no matter how tall the quote ends up being.

Also, when you have time, get rid of all the !Execute bangs and fix the !Rainmeter... bangs. All that stuff has been obsolete for like a decade.
Hey, thanks! That did fix that huge space, but there still seems to be an issue. It still gets cut off, it doesn't continue onto another line. What can I do to fix that?
Capture.PNG
I don't really know what's obsolete or not. I'm really knew to rainmeter and this is a skin I just downloaded. I know really basic rainmeter stuff, but past that I'm clueless. Thank you for letting me know, though!
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Dynamic Quotes

Post by eclectic-tech »

ZStud wrote: December 27th, 2022, 10:10 pm Hey, thanks! That did fix that huge space, but there still seems to be an issue. It still gets cut off, it doesn't continue onto another line. What can I do to fix that?

Capture.PNG

I don't really know what's obsolete or not. I'm really knew to rainmeter and this is a skin I just downloaded. I know really basic rainmeter stuff, but past that I'm clueless. Thank you for letting me know, though!
Remove any W=xxx and H=xxx from [MeterQuote] and add ClipString=2 and ClipStringW=450 in [MeterQuote].

This will clip strings at a width of 450 pixels and expand downward as much as needed to show the entire string. I would suggest adding SolidColor=0,0,0,1 to any String meter that has mouse action bangs associated with it; this lets the mouse react to the entire meter area and not just the actual letter characters.

Also, I noticed you had multiple mouse bangs on the same line; each needs to be on a new line.
LeftMouseUpAction is preferred versus LeftMouseDownAction; the down action prevents dragging skins to position them without using the Ctrl key in combination.

Code: Select all

[MeterQuote] 
Meter=String 
MeasureName=MeasureQuote
X=5 
Y=40
; W=950
; H=200
ClipString=2 
ClipStringW=450
FontColor=#TextColor#
FontFace=Aquatico
FontSize=20
StringAlign=LEFT
StringStyle=NORMAL
SolidColor=0,0,0,1
AntiAlias=1
MouseOverAction=[!ShowMeter MeterHover1][!Redraw]
MouseLeaveAction=[!HideMeter MeterHover1][!Redraw]
LeftMouseUpAction=[MeasureRSS1Link]
There are several other suggestions to use the info you are parsing, but first let us know if this takes care of the display issues.
ZStud
Posts: 8
Joined: November 14th, 2022, 4:49 pm

Re: Dynamic Quotes

Post by ZStud »

eclectic-tech wrote: December 28th, 2022, 3:14 am Remove any W=xxx and H=xxx from [MeterQuote] and add ClipString=2 and ClipStringW=450 in [MeterQuote].

This will clip strings at a width of 450 pixels and expand downward as much as needed to show the entire string. I would suggest adding SolidColor=0,0,0,1 to any String meter that has mouse action bangs associated with it; this lets the mouse react to the entire meter area and not just the actual letter characters.

Also, I noticed you had multiple mouse bangs on the same line; each needs to be on a new line.
LeftMouseUpAction is preferred versus LeftMouseDownAction; the down action prevents dragging skins to position them without using the Ctrl key in combination.

Code: Select all

[MeterQuote] 
Meter=String 
MeasureName=MeasureQuote
X=5 
Y=40
; W=950
; H=200
ClipString=2 
ClipStringW=450
FontColor=#TextColor#
FontFace=Aquatico
FontSize=20
StringAlign=LEFT
StringStyle=NORMAL
SolidColor=0,0,0,1
AntiAlias=1
MouseOverAction=[!ShowMeter MeterHover1][!Redraw]
MouseLeaveAction=[!HideMeter MeterHover1][!Redraw]
LeftMouseUpAction=[MeasureRSS1Link]
There are several other suggestions to use the info you are parsing, but first let us know if this takes care of the display issues.
Hey, thank you! From what I can tell, it seems to be working now. I only had to up the width because my screen is pretty big, but other than that it seems to be working now! It's a small quote today, so once I get a big quote I'll know for sure, but this does seem to have fixed my problem. Thanks again! What were the suggestions you were talking about?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Dynamic Quotes

Post by eclectic-tech »

ZStud wrote: December 28th, 2022, 6:54 pm {clip}
What were the suggestions you were talking about?
I know you are new to editing Rainmeter, so first make a copy of your skin file. These steps may seem overwhelming at first, but in reality, most of it you can copy and paste to make the changes.

The main change

First, you have 3 Webparser measures that access the same site individually. They should be combined into 1 Webparser measure; this means the skin only accesses the site 1 time instead of 3 times to get the information.

Also, the Webparser measures you have return 5 authors, 5 quotes, 5 pub dates, and 5 links but you are only using the third one when you specify StringIndex=3 in each of them.

By combining these into 1 Webparser measure, and some additional Webparser child measures to collect the details, you can have 5 quotes to display randomly, in sequence, or at specific times.

Combining requires copying the captures, <description>(.*)</description and <pubdate>(.*)</pubdate> and pasting them, in the correct order as they appear on the site, into the first Webparser measure RegExpression.

Here is the new [MeasureQuote] section (replace the current [MeasureQuote] with this code, and delete [MeasureAuthor] and [MeasureTime] seections):

Code: Select all

[MeasureQuote] 
Measure=Plugin 
Plugin=Plugins\WebParser.dll 
URL=#RSS#
RegExp="(?siU)<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>" 
FinishAction=[!UpdateMeter *][!Redraw]
Because now everything is captured in one expression, you need to add child measures to identify each author, quote, date, and link; that's 4 measures for each of the 5 quote items (20 additional, nearly identical, uniquely named measures).

Here are the new child measures. Note each has a unique name that includes a number we will use later to control the display.

Code: Select all

[mAuthor1]
Measure=WebParser
Url=[MeasureQuote]
StringIndex=3

[mQuote1]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=4
Substitute=#Substitute# 

[mDate1]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=5

[mLink1]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=6

[mAuthor2]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=7

[mQuote2]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=8
Substitute=#Substitute# 

[mDate2]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=9

[mLink2]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=10

[mAuthor3]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=11

[mQuote3]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=12
Substitute=#Substitute# 

[mDate3]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=13

[mLink3]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=14

[mAuthor4]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=15

[mQuote4]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=16
Substitute=#Substitute# 

[mDate4]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=17

[mLink4]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=18

[mAuthor5]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=19

[mQuote5]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=20
Substitute=#Substitute# 

[mDate5]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=21

[mLink5]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=22

You will need to create a variable with a value from 1 to 5 so you can control which quote details are displayed; call it 'Count' and set its initial value to '1'.

Code: Select all

[Variables] 
Count=1
TextColor=255,255,255,160
LabelColor=255,255,255,90
LineHeight=69
RSS=http://www.quotationspage.com/data/qotd.rss 
Substitute="":"...","&amp;":"&","&quot;":"'","<![CDATA[":"","]]>":"" 

Because you will be changing the 'Count' you must add DynamicVariables=1 to both string meters.
Then only change the MeasureName= value in both meters to show the new child measures mQuote#Count# and mAuthor#Count#;

Code: Select all

[MeterQuote]
Meter=String
MeasureName=mQuote#Count#
...

[MeterAuthor]
Meter=String
MeasureName=mAuthor#Count#
...

The last option is to add a mouse action bang to change the 'Count' variable (looping 1~5), update the meters, and redraw the skin.
Add this to either string meter; I show it added to [MeterQuote]:

Code: Select all

[MeterQuote] 
Meter=String 
MeasureName=mQuote#Count#
X=5 
Y=40
; W=950
; H=200
ClipString=2 
ClipStringW=450
FontColor=#TextColor#
FontFace=Aquatico
FontSize=20
StringAlign=LEFT
StringStyle=NORMAL
SolidColor=0,0,0,1
AntiAlias=1
; MouseOverAction=[!ShowMeter MeterHover1][!Redraw]
; MouseLeaveAction=[!HideMeter MeterHover1][!Redraw]
LeftMouseUpAction=[!SetVariable Count ((#Count#%5)+1)][!UpdateMeter *][!Redraw]
DynamicVariables=1

Save these changes with a new name in the same folder as your original and click "Rrefresh All" in the Manage dialog window.

When you load the new skin, and left click on the quote text, the next quote will be displayed.

If this doesn't work, double check that the changes were made correctly, save and refresh. Still not right, come back with your modified code.
You can always use your original skin that you saved at the start.

Happy coding! :welcome:
ZStud
Posts: 8
Joined: November 14th, 2022, 4:49 pm

Re: Dynamic Quotes

Post by ZStud »

eclectic-tech wrote: December 28th, 2022, 8:51 pm I know you are new to editing Rainmeter, so first make a copy of your skin file. These steps may seem overwhelming at first, but in reality, most of it you can copy and paste to make the changes.

The main change

First, you have 3 Webparser measures that access the same site individually. They should be combined into 1 Webparser measure; this means the skin only accesses the site 1 time instead of 3 times to get the information.

Also, the Webparser measures you have return 5 authors, 5 quotes, 5 pub dates, and 5 links but you are only using the third one when you specify StringIndex=3 in each of them.

By combining these into 1 Webparser measure, and some additional Webparser child measures to collect the details, you can have 5 quotes to display randomly, in sequence, or at specific times.

Combining requires copying the captures, <description>(.*)</description and <pubdate>(.*)</pubdate> and pasting them, in the correct order as they appear on the site, into the first Webparser measure RegExpression.

Here is the new [MeasureQuote] section (replace the current [MeasureQuote] with this code, and delete [MeasureAuthor] and [MeasureTime] seections):

Code: Select all

[MeasureQuote] 
Measure=Plugin 
Plugin=Plugins\WebParser.dll 
URL=#RSS#
RegExp="(?siU)<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>.*<link>(.*)</link>" 
FinishAction=[!UpdateMeter *][!Redraw]
Because now everything is captured in one expression, you need to add child measures to identify each author, quote, date, and link; that's 4 measures for each of the 5 quote items (20 additional, nearly identical, uniquely named measures).

Here are the new child measures. Note each has a unique name that includes a number we will use later to control the display.

Code: Select all

[mAuthor1]
Measure=WebParser
Url=[MeasureQuote]
StringIndex=3

[mQuote1]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=4
Substitute=#Substitute# 

[mDate1]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=5

[mLink1]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=6

[mAuthor2]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=7

[mQuote2]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=8
Substitute=#Substitute# 

[mDate2]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=9

[mLink2]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=10

[mAuthor3]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=11

[mQuote3]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=12
Substitute=#Substitute# 

[mDate3]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=13

[mLink3]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=14

[mAuthor4]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=15

[mQuote4]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=16
Substitute=#Substitute# 

[mDate4]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=17

[mLink4]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=18

[mAuthor5]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=19

[mQuote5]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=20
Substitute=#Substitute# 

[mDate5]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=21

[mLink5]
Measure=WebParser
URL=[MeasureQuote]
StringIndex=22

You will need to create a variable with a value from 1 to 5 so you can control which quote details are displayed; call it 'Count' and set its initial value to '1'.

Code: Select all

[Variables] 
Count=1
TextColor=255,255,255,160
LabelColor=255,255,255,90
LineHeight=69
RSS=http://www.quotationspage.com/data/qotd.rss 
Substitute="":"...","&amp;":"&","&quot;":"'","<![CDATA[":"","]]>":"" 

Because you will be changing the 'Count' you must add DynamicVariables=1 to both string meters.
Then only change the MeasureName= value in both meters to show the new child measures mQuote#Count# and mAuthor#Count#;

Code: Select all

[MeterQuote]
Meter=String
MeasureName=mQuote#Count#
...

[MeterAuthor]
Meter=String
MeasureName=mAuthor#Count#
...

The last option is to add a mouse action bang to change the 'Count' variable (looping 1~5), update the meters, and redraw the skin.
Add this to either string meter; I show it added to [MeterQuote]:

Code: Select all

[MeterQuote] 
Meter=String 
MeasureName=mQuote#Count#
X=5 
Y=40
; W=950
; H=200
ClipString=2 
ClipStringW=450
FontColor=#TextColor#
FontFace=Aquatico
FontSize=20
StringAlign=LEFT
StringStyle=NORMAL
SolidColor=0,0,0,1
AntiAlias=1
; MouseOverAction=[!ShowMeter MeterHover1][!Redraw]
; MouseLeaveAction=[!HideMeter MeterHover1][!Redraw]
LeftMouseUpAction=[!SetVariable Count ((#Count#%5)+1)][!UpdateMeter *][!Redraw]
DynamicVariables=1

Save these changes with a new name in the same folder as your original and click "Rrefresh All" in the Manage dialog window.

When you load the new skin, and left click on the quote text, the next quote will be displayed.

If this doesn't work, double check that the changes were made correctly, save and refresh. Still not right, come back with your modified code.
You can always use your original skin that you saved at the start.

Happy coding! :welcome:
Hey, honestly, this was super awesome. I got it to work, so thank you so much. It was super nice of you to help me make it better. I'm really happy with it now. Thanks for helping me out.

One last thing. I have a weather skin, and it broke once and someone helped me fix it, and now it seems to be broken again. It just won't display right. My city doesn't pop up. Do you know what the issue is?

Here's the code:

Code: Select all

[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh] 
LeftMouseDoubleClickAction=!ToggleConfig "Lasix\Settings" "Settings.ini"

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
Scale=0.56

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureWeather]
Measure=Plugin
Plugin=WebParser
URL=https://www.yahoo.com/news/weather
RegExp=(?siU)<h1 class="city.*data-reactid="7">(.*)</h1>.*<div class="My\(2px\).*60x60\/(.*)@2x.png.*data-reactid=".*">(.*)<.*<span class="Va\(t\)" data-reactid=".*">(.*)</span> 
UpdateRate=900

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureLocation]
Measure=Plugin
Plugin=WebParser
URL=[MeasureWeather]
StringIndex=1
DynamicVariables=1

[MeasureWeatherIcons]
Measure=Plugin
Plugin=WebParser
URL=[MeasureWeather]
StringIndex=2
DynamicVariables=1
Substitute="rain_day_night":"rain","scattered_showers_day_night":"rain","windy_day_night":"wind","mostly_cloudy_day_night":"cloudy","cloudy_day_night":"cloudy","snow_rain_mix_day_night":"sleet","fair_day":"clear_day","fair_night":"clear_night","flurries_day_night":"snow","snow_day_night":"snow","thundershowers_day_night":"rain","fog_day_night":"fog"

[MeasureWeatherCond]
Measure=Plugin
Plugin=WebParser
URL=[MeasureWeather]
StringIndex=3
DynamicVariables=1
Substitute=#Conditions#

[MeasureTempFahrenheit]
Measure=Plugin
Plugin=WebParser
URL=[MeasureWeather]
StringIndex=4
DynamicVariables=1

[MeasureTempCelsius]
Measure=Calc
Formula=Round((MeasureTempFahrenheit-32)*5/9)
Substitute="-18":""

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentIcon]
Meter=Image
MeasureName=MeasureWeatherIcons
Path=#@#WeatherIcons
X=(0*#Scale#)
Y=(0*#Scale#)
W=(150*#Scale#)
AntiAlias=1

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterLocation]
Meter=String
MeasureName=MeasureLocation
StringAlign=Left
StringCase=Upper
FontFace=Aquatico
FontColor=#Color1#
FontSize=(28*#Scale#)
X=(150*#Scale#)
Y=(40*#Scale#)
Text="%1"
AntiAlias=1

[MeterCurrentCond]
Meter=String
MeasureName=MeasureWeatherCond
MeasureName2=#MeasureName2#
StringAlign=Left
StringCase=Upper
FontFace=Aquatico
FontColor=#Color1#
FontSize=(16*#Scale#)
X=(150*#Scale#)
Y=(80*#Scale#)
Text="%1 %2°#TempSymbol#"
AntiAlias=1
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Dynamic Quotes

Post by eclectic-tech »

ZStud wrote: December 28th, 2022, 10:57 pm {clip...}
One last thing. I have a weather skin, and it broke once and someone helped me fix it, and now it seems to be broken again. It just won't display right. My city doesn't pop up. Do you know what the issue is?
{clip code}
Make the change suggested by xenium in this post.
With the updated [MeasureWeather] section the skin should work when refreshed.