It is currently April 27th, 2024, 6:35 am

How to change download link (image)

Get help with creating, editing & fixing problems with skins
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

How to change download link (image)

Post by fabularasa »

http://th02.deviantart.net/fs70/150/i/2011/084/2/0/qpp_by_blearat-d3cfnzs.png
change for
http://th02.deviantart.net/fs70/i/2011/084/2/0/qpp_by_blearat-d3cfnzs.png

[...]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[...]
Substitute="100/":""
StringIndex=...
Download=1

It doeasnt work ;(


http://browse.deviantart.com/?order=1&q=rainmeter

Code: Select all

<span class="tt-w"><span class="shadow" style="background-image:url(http://sh.deviantart.net/shadow/x/150/84/logo3.png);"><a class="thumb" href="http://Blearat.deviantart.com/art/QPP-202284856" title="QPP by ~Blearat, Mar 25, 2011 in Customization > Skins & Themes > System Monitoring > Rainmeter"><i></i><img width="150" height="84" src="http://th02.deviantart.net/fs70/150/i/2011/084/2/0/qpp_by_blearat-d3cfnzs.png"></a></span><!-- ^TTT --><a href="http://Blearat.deviantart.com/art/QPP-202284856" class="t" title="QPP by ~Blearat, Mar 25, 2011">QPP</a><br/><small> in <a title="QPP by ~Blearat, Mar 25, 2011" href="http://browse.deviantart.com/customization/skins/sysmonitor/rainmeter/">Rainmeter</a></small><!-- TTT$
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to change download link (image)

Post by jsmorley »

Not sure there is a good way to do what you want.

You can't use a Substitute= statement to modify a URL used for downloading an image. The Substitute happens "after", not "before" the RegExp is executed. Before you think of it, as I certainly did, you can't just use a subsequent WebParser measure using the result of the first one to do the downloading. WebParser measures, like all plugins, are not "dynamic" in that way, and the substitute is ignored by the second WebParser measure using the first as the URL=. Any way you slice it, you are going to get the image reference created by the RegExp.

There may be some clever solution involving Lua, but due to the fact that plugins are not dynamic, even then the best you can probably hope for is that you can get the image, but it will mean doing a refresh of the skin on each execution of the WebParser measure, which is ugly with hair on it.
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

Re: How to change download link (image)

Post by fabularasa »

Is there any way to this by using two measures:

Code: Select all

URL=http://browse.deviantart.com/?order=1&q=rainmeter
RegExp="(?siU)username=".*href="(.*)".*title="(.*) by.*src="(.*)150/(.*)".*"

Code: Select all

[RainmeterImageA]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Rainmeter]
StringIndex=3

[RainmeterImageB]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Rainmeter]
StringIndex=4

[RainmeterImage]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RainmeterImageA][RainmeterImageB]
Download=1
It doesn't work but maybe there's other way?