It is currently May 7th, 2024, 7:02 am

How to change URL of image you want to display

Get help with creating, editing & fixing problems with skins
UpsideDownRide
Posts: 3
Joined: April 24th, 2011, 8:49 pm

How to change URL of image you want to display

Post by UpsideDownRide »

So my problem is this - I want to display thumbnail from Flickr feed. However instead of displaying small (75x75) image I want to display medium size one.

Basically instead of

http://farm6.static.flickr.com/5188/5649325427_5941088f81_s.jpg

I want to display

http://farm6.static.flickr.com/5188/5649325427_5941088f81_m.jpg

I'm new to RainMeter and am no programmer at all so I'm a little bit at loss here of what I can do to achieve this. I tried substitute but that doesn't work - probably cause with download=1 string already points to file location on disk. It's fine when I'm just parsing it without download - this gives me the right URL but now how to use that string to get the actual image I want? :)

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
BackgroundMargins=5,5,5,5
SolidColor=255,255,255,100
DynamicWindowSize=1

[Metadata]
Name=
Config=
Tags=
Preview=
Variant=

[RSS]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://api.flickr.com/services/feeds/groups_pool.gne?id=71917374@N00&lang=en-us&format=rss_200
RegExp="(?siU)<link>.+</link>.*<media:thumbnail url=\"(.+)\""
;Substitute="_s.jpg":"_m.jpg" - This is commented out as it's not a solution. Left it to give you guys idea what I want to achieve :)
UpdateRate=1000
Download=1
StringIndex=1
FinishAction=!RainmeterRedraw
Debug=1

[Image1]
Meter=Image
MeasureName=RSS
X=5
Y=5
W=240
PreserveAspectRatio=1
StringAlign=Center
Will be grateful for any and all help :)
UpsideDownRide
Posts: 3
Joined: April 24th, 2011, 8:49 pm

Re: How to change URL of image you want to display

Post by UpsideDownRide »

No one? :( The only thing I have thought of so far is to process this with a LUA script. I hope though I am missing a simpler solution :)
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: How to change URL of image you want to display

Post by smurfier »

Well, I'm not very good with webparser but you could try...

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
BackgroundMargins=5,5,5,5
SolidColor=255,255,255,100
DynamicWindowSize=1

[Metadata]
Name=
Config=
Tags=
Preview=
Variant=

[RSS]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://api.flickr.com/services/feeds/groups_pool.gne?id=71917374@N00&lang=en-us&format=rss_200
RegExp="(?siU)<link>.+</link>.*<media:thumbnail url=\"(.+)\""
Substitute="_s.jpg":"_m.jpg"
UpdateRate=1000
StringIndex=1
Debug=1

[RSS2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[RSS]
Download=1
FinishAction=!RainmeterRedraw

[Image1]
Meter=Image
MeasureName=RSS2
X=5
Y=5
W=240
PreserveAspectRatio=1
;StringAlign=Center (Doesn't do anything on an Image meter)
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Scolex
Posts: 111
Joined: July 31st, 2010, 8:52 am

Re: How to change URL of image you want to display

Post by Scolex »

Assuming you just want to display the first pic on the page this works.
The pics on the page are already *_m.jpg
Not sure if you are aware of this but you UpdateRate is 16 minutes and 40 seconds
UpdateRate is multiple of base rate from
[Rainmeter]
Update=*
1000 just seems like an odd number for UpdateRate so I thought you may not be aware.

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
BackgroundMargins=5,5,5,5
SolidColor=255,255,255,100
DynamicWindowSize=1

[Metadata]
Name=
Config=
Tags=
Preview=
Variant=

[RSS]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://api.flickr.com/services/feeds/groups_pool.gne?id=71917374@N00&lang=en-us&format=rss_200
RegExp="(?siU)<pubdate>.*quot;><img src="(.*)""
UpdateRate=1000
Download=1
StringIndex=1
FinishAction=!RainmeterRedraw
Debug=1

[Image]
Meter=IMAGE
MeasureName=RSS
X=5
Y=5
W=240
PreserveAspectRatio=1
Antialias=1
DynamicVariables=1
UpsideDownRide
Posts: 3
Joined: April 24th, 2011, 8:49 pm

Re: How to change URL of image you want to display

Post by UpsideDownRide »

Ok this is weird - just yesterday when I was trying to work this out thumbnails in feed were in _s 75x75 format. This kinda solves my problem :) Yeah I'm actually aware on update thing - did just copy paste parts of code from others and that's why the update interval doesn't make much sense - didn't get to tweaking it bit. Thanks for pointing this out though :)

Smurfier - Yeah that would be it :) Somehow I didn't realize that without RegEx WebParser won't parse but just get the URL point it to :)) Oh well started on RainMeter just yesterday - lots to learn I guess ;)

Thanks for the help guys! Much appreciated! :)