It is currently May 2nd, 2024, 6:20 am

Photo RSS help

Get help with creating, editing & fixing problems with skins
deconduo
Posts: 3
Joined: January 8th, 2011, 5:01 pm

Photo RSS help

Post by deconduo »

I'm pretty new to rainmeter and I've been trying to make a skin that will show the latest pictures from a Flickr RSS feed. I've managed to do that much so far, but its not very elegant. I also can't find a way to have it so you can click on the pictures to load up the URL. I've got a measure that gets the URL but when I try to use it doesn't work. Any advice? Thanks :)

Code: Select all

;=================================================

[Rainmeter]
Author=Deconduo
Update=1000

[Metadata]
Name=Flickr RSS Feed
Config=
Description=Gets Pictures from a Flickr RSS Feed
Instructions=Click small button on top left to load
Version=1.0
Tags=RSS
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=0

[StringStyle]
FontColor=255,255,255,255
FontFace=Trebuchet MS
FontSize=12
StringEffect=NONE
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=0

[MeasureXML]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=10000
URL=http://api.flickr.com/services/feeds/photoset.gne?set=72157625605048005&nsid=46382200@N02&lang=en-us
RegExp="(?siU).*"><img src="(.*)" width="(.*)" height="(.*)"(.*)" />.*"><img src="(.*)" width="(.*)" height="(.*)"(.*)" />.*"><img src="(.*)" width="(.*)" height="(.*)"(.*)" />.*"><img src="(.*)" width="(.*)" height="(.*)"(.*)" />.*"


[MeasureImage1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=1
Download=1

[MeasureImage2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=5
Download=1

[MeasureImage3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=9
Download=1

[MeasureImage4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=13
Download=1

[MeasureWidth1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=2

[MeasureWidth2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=6

[MeasureWidth3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=10

[MeasureWidth4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=14


[MeasureURL1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=4

[MeasureURL2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=8

[MeasureURL3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=12

[MeasureURL4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=16

[Background]
Meter=Image
SolidColor=0,0,0,120
W=(#Width1#+#Width2#+#Width3#+#Width4#+50)
H=260

[Width]
Meter=Image
H=10
W=10
SolidColor=0,0,0,120
LeftMouseUpAction=!Execute [!RainmeterWriteKeyValue Variables Width1 [MeasureWidth1]][!RainmeterWriteKeyValue Variables Width2 [MeasureWidth2]][!RainmeterWriteKeyValue Variables Width3 [MeasureWidth3]][!RainmeterWriteKeyValue Variables Width4 [MeasureWidth4]][!RainmeterRefresh]

[MeterImage1]
Meter=IMAGE
MeasureName=MeasureImage1
X=10
Y=10


[MeterImage2]
Meter=IMAGE
MeasureName=MeasureImage2
X=(#Width1#+20)
Y=10



[MeterImage3]
Meter=IMAGE
MeasureName=MeasureImage3
X=(#Width1#+#Width2#+30)
Y=10


[MeterImage4]
Meter=IMAGE
MeasureName=MeasureImage4
X=(#Width1#+#Width2#+#Width3#+40)
Y=10
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Photo RSS help

Post by jsmorley »

There were a couple of things not quite right. You need to use DynamicVariables in a couple of places, and the RegExp for getting the "URL" of the page hosting the image was not working right.

Try this version of your skin, check out what I changed, and it should help:

Code: Select all

[Rainmeter]
Author=Deconduo
Update=1000

[Metadata]
Name=Flickr RSS Feed
Config=
Description=Gets Pictures from a Flickr RSS Feed
Instructions=Click small button on top left to load
Version=1.0
Tags=RSS
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=0

[Variables]
GET=.*<entry>.*posted a photo.*href="(.*)".*img src="(.*)".*width="(.*)"
Width1=0
Width2=0
Width3=0
Width4=0

[StringStyle]
FontColor=255,255,255,255
FontFace=Trebuchet MS
FontSize=12
StringEffect=NONE
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=0

[MeasureXML]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=10000
URL=http://api.flickr.com/services/feeds/photoset.gne?set=72157625605048005&nsid=46382200@N02&lang=en-us
RegExp="(?siU)#GET##GET##GET##GET#"

; 1=> http://www.flickr.com/photos/tiffyundt/5334409332/
; 2=> http://farm6.static.flickr.com/5243/5334409332_27bfbfcf20_m.jpg
; 3=> 159

[MeasureURL1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=1

[MeasureImage1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=2
Download=1

[MeasureWidth1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=3

[MeasureURL2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=4

[MeasureImage2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=5
Download=1

[MeasureWidth2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=6

[MeasureURL3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=7

[MeasureImage3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=8
Download=1

[MeasureWidth3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=9

[MeasureURL4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=10

[MeasureImage4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=11
Download=1

[MeasureWidth4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
URL=[MeasureXML]
StringIndex=12


[Background]
Meter=Image
SolidColor=0,0,0,120
W=(#Width1#+#Width2#+#Width3#+#Width4#+50)
H=260
DynamicVariables=1

[Width]
Meter=Image
H=10
W=10
SolidColor=0,0,0,120
LeftMouseUpAction=!Execute [!RainmeterWriteKeyValue Variables Width1 [MeasureWidth1]][!RainmeterWriteKeyValue Variables Width2 [MeasureWidth2]][!RainmeterWriteKeyValue Variables Width3 [MeasureWidth3]][!RainmeterWriteKeyValue Variables Width4 [MeasureWidth4]][!RainmeterRefresh]

[MeterImage1]
Meter=IMAGE
MeasureName=MeasureImage1
X=10
Y=10
PreserveAspectRatio=1
DynamicVariables=1
LeftMouseUpAction=!Execute ["[MeasureURL1]"]

[MeterImage2]
Meter=IMAGE
MeasureName=MeasureImage2
X=(#Width1#+20)
Y=10
PreserveAspectRatio=1
DynamicVariables=1
LeftMouseUpAction=!Execute ["[MeasureURL2]"]

[MeterImage3]
Meter=IMAGE
MeasureName=MeasureImage3
X=(#Width1#+#Width2#+30)
Y=10
PreserveAspectRatio=1
DynamicVariables=1
LeftMouseUpAction=!Execute ["[MeasureURL3]"]

[MeterImage4]
Meter=IMAGE
MeasureName=MeasureImage4
X=(#Width1#+#Width2#+#Width3#+40)
Y=10
PreserveAspectRatio=1
DynamicVariables=1
LeftMouseUpAction=!Execute ["[MeasureURL4]"]
1-8-2011 12-50-21 PM.png
P.S. I'm not sure I would have gone the approach you did with "writing" the width variables and refreshing, as I don't think it is really needed. Just set the variables to start with, using a value of "0" or something:

[Variables]
Width1=0

Then when you retrieve the actual width from the site in [MeasureWidth1] you could add a line:

FinishAction=!RainmeterSetVariable Width1 [MeasureWidth1]

Then be sure all measures using #Width1# have DynamicVariables=1 on them. Spit, rinse and repeat for 2,3,4.

I have not tested it fully, but something like that should work and save a lot of writing and refreshing. In any case, your approach works fine.
You do not have the required permissions to view the files attached to this post.
deconduo
Posts: 3
Joined: January 8th, 2011, 5:01 pm

Re: Photo RSS help

Post by deconduo »

That works great, thanks a million :)

I was trying: LeftMouseUpAction=!Execute [[MeasureURL1]] without the " thats one the mistakes I made I think. Also thanks for cleaning up the RegEx stuff too, I never would have though of doing something like that.

Edit: Will try out that other suggestion too, having to manually refresh is kind of awkward.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Photo RSS help

Post by jsmorley »

Glad to help.

BTW: I added "PreserveAspectRatio=1" to each image meter in my code above, just in case they are odd sizes from time to time, so they don't squish or stretch weird. You may or may not want that, up to you. If you want to retain that "panel" look, you might want to look at ImageCrop if you are using a recent 1.4 beta of Rainmeter. You could go that way too...