It is currently April 24th, 2024, 10:11 pm

Twitter Skin - Tooltips and Regex substitution

Get help with creating, editing & fixing problems with skins
User avatar
Raikuga
Posts: 12
Joined: May 20th, 2010, 11:00 pm

Twitter Skin - Tooltips and Regex substitution

Post by Raikuga »

I made a skin that reads from Twitter and now I'm trying to update it to use the newly added Tooltips to display the full tweet's text. But I just don't know how to get it working. I know it's something simple, but I've never used dynamic variables before.

Also, another problem that has been a problem before trying to add tooltips is that the substitute doesn't work... How do I get that working?

Code: Select all

[Rainmeter]
Update=1000
Author=Raikuga

[Metadata]
Name=Twitter Feed
Config=Raikuga | Twitter
Description=Reads most recent tweets that you follow
Instructions=
Version=1.0
Tags=Twitter
License=
Variant=
Preview=

[Variables]
@include=#SKINSPATH#Raikuga\Variables.inc
Sub="&":"&",""":""","<":"<",">":">"
Username=UN
Password=PW
W=400

[Tweet]
DynamicVariables=1
FontColor=#Color1#
FontFace=#Font2#
FontSize=10
AntiAlias=1
ClipString=1
X=0
Y=R
W=#W#
H=14

[Feed]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://#Username#:#Password#@twitter.com/statuses/friends_timeline.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>)(?(?=.*<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>)(?(?

=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)"
Substitute=#Sub#
UpdateRate=600

[Tweet1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=3
[Tweet1Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=4
[Tweet2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=5
[Tweet2Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=6
[Tweet3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=7
[Tweet3Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=8
[Tweet4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=9
[Tweet4Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=10
[Tweet5]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=11
[Tweet5Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=12
[Tweet6]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=13
[Tweet6Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=14
[Tweet7]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=15
[Tweet7Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=16
[Tweet8]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=17
[Tweet8Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=18
[Tweet9]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=19
[Tweet9Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=20
[Tweet10]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
Substitute=#Sub#
StringIndex=21
[Tweet10Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=22

[TwitterLogo]
Meter=Image
ImageName=Twitter.png
ImageTint=#Color1FG#
PreserveAspectRatio=1
H=45
[Header]
Meter=String
Text="@#Username#"
FontColor=#Color2#
FontFace=#Font2#
FontSize=16
AntiAlias=1
X=R
Y=10
LeftMouseUpAction=!Execute ["http://www.twitter.com"]
[Border]
Meter=Image
SolidColor=#Color3#
SolidColor2=0,0,0,0
X=0
Y=45
H=1
W=#W#
[MeterTweet1]
Meter=String
MeasureName=Tweet1
MeterStyle=Tweet
ToolTipText=Tweet1
LeftMouseUpAction=!Execute [[Tweet1Link]]
[MeterTweet2]
Meter=String
MeasureName=Tweet2
MeterStyle=Tweet
ToolTipText=Tweet2
LeftMouseUpAction=!Execute [[Tweet2Link]]
[MeterTweet3]
Meter=String
MeasureName=Tweet3
MeterStyle=Tweet
ToolTipText=Tweet3
LeftMouseUpAction=!Execute [[Tweet3Link]]
[MeterTweet4]
Meter=String
MeasureName=Tweet4
MeterStyle=Tweet
ToolTipText=Tweet4
LeftMouseUpAction=!Execute [[Tweet4Link]]
[MeterTweet5]
Meter=String
MeasureName=Tweet5
MeterStyle=Tweet
ToolTipText=Tweet5
LeftMouseUpAction=!Execute [[Tweet5Link]]
[MeterTweet6]
Meter=String
MeasureName=Tweet6
MeterStyle=Tweet
ToolTipText=Tweet6
LeftMouseUpAction=!Execute [[Tweet6Link]]
[MeterTweet7]
Meter=String
MeasureName=Tweet7
MeterStyle=Tweet
ToolTipText=Tweet7
LeftMouseUpAction=!Execute [[Tweet7Link]]
[MeterTweet8]
Meter=String
MeasureName=Tweet8
MeterStyle=Tweet
ToolTipText=Tweet8
LeftMouseUpAction=!Execute [[Tweet8Link]]
[MeterTweet9]
Meter=String
MeasureName=Tweet9
MeterStyle=Tweet
ToolTipText=Tweet9
LeftMouseUpAction=!Execute [[Tweet9Link]]
[MeterTweet10]
Meter=String
MeasureName=Tweet10
MeterStyle=Tweet
ToolTipText=Tweet10
LeftMouseUpAction=!Execute [[Tweet10Link]]
[Border2]
Meter=Image
SolidColor=#Color3#
SolidColor2=0,0,0,0
X=0
Y=1R
H=1
W=#W#
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Twitter Skin

Post by Alex2539 »

Your problems are two-fold. First, in order to use a measure's value for the tooltip, you will need to use it as a dynamic variable. To do that, just encase the measure's name in square brackets and then add the line "DynamicVariables=1" to the meter. Second, tooltips currently have an issue where they will not show if their entire text consists of the value of a plugin. To get around that, all you need to do is add another character to the text.

One of your meters would look like this:

Code: Select all

[MeterTweet1]
Meter=String
MeasureName=Tweet1
MeterStyle=Tweet
ToolTipText="~[Tweet1]"
LeftMouseUpAction=!Execute [[Tweet1Link]]
DynamicVariable=1
Just do this for each of the meters with a tooltip. The ~ in ToolTipText is just an extra character to make sure that it shows. You can change that to anything else. In the next beta, that issue will be resolved so that the extra character is unnecessary.
ImageImageImageImage
User avatar
Raikuga
Posts: 12
Joined: May 20th, 2010, 11:00 pm

Re: Twitter Skin - Tooltips and Regex substitution

Post by Raikuga »

I already had DynamicVariables=1 set in the Tweet meter style. I changed all the tooltip texts as you said and the tooltips work well. Thanks for your help.

Now my only problem with the skin is the regex substitution...