It is currently April 27th, 2024, 1:25 pm

Not working

Get help with creating, editing & fixing problems with skins
desin
Posts: 5
Joined: August 4th, 2012, 8:27 pm

Not working

Post by desin »

Code: Select all

[MeasureWebsite]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=http://im-to-poor-to-buy-an-domain.my.gp/
RegExp=(?siU)\(\{"0":"(.*)","1":"(.*)","2":"(.*)","3":"(.*)","4":"(.*)","5":"(.*)","6":"(.*)","7":"(.*)","8":"(.*)","9":"(.*)"

[mChamp1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=1
Substitute="\":""

[mImage1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mChamp1]
Download=1

[Meter1]
Meter=IMAGE
MeasureName=[mImage1]
FontFace=#FontFace#
Antialias=1
DynamicVariables=1
X=#FirstIconPositionx#
Y=#FirstIconPositiony#
H=#ImageSize#
PreserveAspectRatio=1
Why isn't this working?
I think the problem is in Url=[mChamp1] but I dont know how to do it any other way.
measure website returns links, which have "\" near every "/", so i used substitute to delete those.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Not working

Post by jsmorley »

This is a tricky little challenge. The problem is that both "child" measures and the Download=1 option ignore any "Substitute" values.

So I don't think there is a way to get the images from that site in native Rainmeter.

However, we can do it with a really simple Lua script, and a somewhat less simple (but not too bad) skin.

Skin:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureWebsite]
Measure=Plugin
Plugin=WebParser.dll
UpdateRate=1800
Url=http://im-to-poor-to-buy-an-domain.my.gp/
RegExp="(?siU)^(.*)$"
StringIndex=1
FinishAction=[!DisableMeasureGroup LocalFile][!EnableMeasure MeasureLuaScript]

[MeasureLuaScript]
Measure=Script
ScriptFile=#CURRENTPATH#XTest.lua
Disabled=1

[MeasureFile]
Measure=Plugin
Plugin=WebParser.dll
Group=LocalFile
Url=file://#CURRENTPATH#Output.txt
RegExp="(?siU)\(\{"0":"(.*)","1":"(.*)","2":"(.*)","3":"(.*)","4":"(.*)","5":"(.*)","6":"(.*)","7":"(.*)","8":"(.*)""
Disabled=1

[MeasureImage1]
Measure=Plugin
Plugin=WebParser.dll
Group=LocalFile
Url=[MeasureFile]
StringIndex=1
Download=1
Disabled=1

[MeasureImage2]
Measure=Plugin
Plugin=WebParser.dll
Group=LocalFile
Url=[MeasureFile]
StringIndex=2
Download=1
Disabled=1

[MeasureImage3]
Measure=Plugin
Plugin=WebParser.dll
Group=LocalFile
Url=[MeasureFile]
StringIndex=3
Download=1
Disabled=1

[MeasureImage4]
Measure=Plugin
Plugin=WebParser.dll
Group=LocalFile
Url=[MeasureFile]
StringIndex=4
Download=1
Disabled=1

[MeasureImage5]
Measure=Plugin
Plugin=WebParser.dll
Group=LocalFile
Url=[MeasureFile]
StringIndex=5
Download=1
Disabled=1

[MeasureImage6]
Measure=Plugin
Plugin=WebParser.dll
Group=LocalFile
Url=[MeasureFile]
StringIndex=6
Download=1
Disabled=1

[MeasureImage7]
Measure=Plugin
Plugin=WebParser.dll
Group=LocalFile
Url=[MeasureFile]
StringIndex=7
Download=1
Disabled=1

[MeasureImage8]
Measure=Plugin
Plugin=WebParser.dll
Group=LocalFile
Url=[MeasureFile]
StringIndex=8
Download=1
Disabled=1

[MeterImage1]
Meter=Image
MeasureName=MeasureImage1

[MeterImage2]
Meter=Image
X=5R
MeasureName=MeasureImage2

[MeterImage3]
Meter=Image
X=5R
MeasureName=MeasureImage3

[MeterImage4]
Meter=Image
X=5R
MeasureName=MeasureImage4

[MeterImage5]
Meter=Image
X=5R
MeasureName=MeasureImage5

[MeterImage6]
Meter=Image
X=5R
MeasureName=MeasureImage6

[MeterImage7]
Meter=Image
X=5R
MeasureName=MeasureImage7

[MeterImage8]
Meter=Image
X=5R
MeasureName=MeasureImage8
Lua:

Code: Select all

function Initialize()

	msSite = SKIN:GetMeasure('MeasureWebsite')
	msPath = SKIN:GetVariable('CURRENTPATH')
	
end -->Initialize

function Update()

	sInput = msSite:GetStringValue()
	sOutput = string.gsub(sInput, '\\', '')
	
	hFile = io.open(msPath..'Output.txt', 'w')
	hFile:write(sOutput)
	hFile:close()
	
	SKIN:Bang('!EnableMeasureGroup', 'LocalFile')
	SKIN:Bang('!DisableMeasure', 'MeasureLuaScript')
	
end -->Update
Try this:
XTest_.rmskin
8-6-2012 1-48-19 PM.jpg
What we are doing is getting the entire text of the web site in the main WebParser measure.

Then with FinishAction we fire up the Lua script. The Lua parses the result and removes
the "\" characters, then writes it to a local file. The Lua then "enables" some patiently waiting measures in the skin.

Those measures then use that local file with a normal WebParser "parent / child" approach to download the images, and we display them in meters.

Let me know if you have any questions, this might take just a couple of minutes to wrap your head around.
You do not have the required permissions to view the files attached to this post.
desin
Posts: 5
Joined: August 4th, 2012, 8:27 pm

Re: Not working

Post by desin »

Thanks! And you actually finished the skin. :D Awesome support! :thumbup: