It is currently May 20th, 2022, 10:01 am

Loading an image

General topics related to Rainmeter.
Besley
Posts: 5
Joined: December 4th, 2010, 6:16 am

Loading an image

Post by Besley »

Is there any skins out there which parses a static image into the skin from the web. via http address
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Loading an image

Post by poiru »

Besley wrote:Is there any skins out there which parses a static image into the skin from the web. via http address
Yes. You can use WebParser and Download=1 to do that.

There are many skins that do this. The InterfaceLIFT skin of Rainify is one: http://poiru.deviantart.com/art/Rainify-1-0-RC-170149696
Besley
Posts: 5
Joined: December 4th, 2010, 6:16 am

Re: Loading an image

Post by Besley »

do you have another example?

im trying to parse this image http://sg.finance.yahoo.com/q/bc?s=USDJPY=X&t=5d

so im assuming the url is as follows
http://chart.finance.yahoo.com/z?s=USDJPY%3dX&t=5d&q=&l=&z=l&p=s&a=v&p=s&lang=en-SG&region=SG


how ever, seemingly the skin doesnt seem to be able to extract the info because iassume ofthe variable;div class tags

however im unable to customise it to work

any help?
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Loading an image

Post by Kaelri »

I was able to get this working by adding the "DownloadFile" key. Presently updates once per hour. (UpdateRate is expressed in seconds, in this case.)

Code: Select all

[Rainmeter]
Update=1000

[MeasureImage]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://chart.finance.yahoo.com/z?s=USDJPY%3dX&t=5d&q=&l=&z=l&p=s&a=v&p=s&lang=en-SG&region=SG
UpdateRate=3600
Download=1
DownloadFile=#CURRENTPATH#image.png

[DisplayImage]
Meter=IMAGE
ImageName=#CURRENTPATH#DownloadFile\image.png
Besley
Posts: 5
Joined: December 4th, 2010, 6:16 am

Re: Loading an image

Post by Besley »

Hmmm not getting it still , i see the download folder getting created by no file gets made,

Code: Select all

[Rainmeter]
Author=poiru
AppVersion=1003000
Update=1000
MouseActionCursor=0
MiddleMouseDownAction=!Execute [!RainmeterDeactivateConfig]
MouseLeaveAction=!Execute [!RainmeterHideMeter Feed1.Grabber][!RainmeterHideMeter Feed2.Grabber][!RainmeterHideMeter Feed3.Grabber][!RainmeterHideMeter Feed4.Grabber][!RainmeterHideMeter Feed1.Active][!RainmeterHideMeter Feed2.Active][!RainmeterHideMeter Feed3.Active][!RainmeterHideMeter Feed4.Active][!RainmeterHideMeter X][!RainmeterEnableMeasure mShow1][!RainmeterDisableMeasure mShow2][!RainmeterDisableMeasure mShow3][!RainmeterDisableMeasure mShow4][!RainmeterRedraw]

[Metadata]
Name=InterfaceLIFT
Description=Shows the latest wallpapers from InterfaceLIFT.
Version=1.0.0
License=Creative Commons BY-NC-SA 3.0

[Variables]
NO=1
GET=<div class="item">.*<a href="(.*)">.*src="(.*)".*
@Include=#ROOTCONFIGPATH#\@Settings\Variables.inc

; MEASURES ====================================

[mFeed]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://chart.finance.yahoo.com/z?s=USDJPY%3dX&t=5d&q=&l=&z=l&p=s&a=v&p=s&lang=en-SG&region=SG
RegExp="(?siU)#GET##GET##GET##GET#"
UpdateRate=7200

[mLink1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mFeed]
StringIndex=1

[mImage1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mFeed]
StringIndex=2
Download=1
DownloadFile=#CURRENTPATH#imageGOD.png

[mLink2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mFeed]
StringIndex=3

[mImage2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mFeed]
StringIndex=4
Download=1

[mLink3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mFeed]
StringIndex=5

[mImage3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mFeed]
StringIndex=6
Download=1

[mLink4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mFeed]
StringIndex=7

[mImage4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mFeed]
StringIndex=8
Download=1

[mShow1]
Measure=CALC
Formula=Counter % 32
MinValue=0
MaxValue=32
IfAboveValue=30
ButtonCommand=!Execute [!RainmeterSetVariable NO 1][!RainmeterDisableMeasure mShow1][!RainmeterEnableMeasure mShow2][!RainmeterDisableMeasure mShow3][!RainmeterDisableMeasure mShow4][!RainmeterRedraw]
Disabled=1

[mShow2]
Measure=CALC
Formula=Counter % 32
MinValue=0
MaxValue=32
IfAboveValue=30
ButtonCommand=!Execute [!RainmeterSetVariable NO 2][!RainmeterDisableMeasure mShow1][!RainmeterDisableMeasure mShow2][!RainmeterEnableMeasure mShow3][!RainmeterDisableMeasure mShow4][!RainmeterRedraw]

[mShow3]
Measure=CALC
Formula=Counter % 32
MinValue=0
MaxValue=32
IfAboveValue=30
ButtonCommand=!Execute [!RainmeterSetVariable NO 3][!RainmeterDisableMeasure mShow1][!RainmeterDisableMeasure mShow2][!RainmeterDisableMeasure mShow3][!RainmeterEnableMeasure mShow4][!RainmeterRedraw]
Disabled=1

[mShow4]
Measure=CALC
Formula=Counter % 32
MinValue=0
MaxValue=32
IfAboveValue=30
ButtonCommand=!Execute [!RainmeterSetVariable NO 4][!RainmeterEnableMeasure mShow1][!RainmeterDisableMeasure mShow2][!RainmeterDisableMeasure mShow3][!RainmeterDisableMeasure mShow4][!RainmeterRedraw]
Disabled=1

; STYLES ======================================

@Include2=#ROOTCONFIGPATH#\@Settings\Styles.inc

; METERS ======================================

[Image]
Meter=IMAGE
ImageName=[mImage#NO#]
X=5
Y=4
W=200
H=125
DynamicVariables=1

[Outline]
Meter=IMAGE
MeterStyle=sOutline
ImageName=#ROOTCONFIGPATH#\@Settings\200x125.png

[TextArea]
Meter=IMAGE
MeterStyle=sTextArea
H=125
SolidColor=00000001
MouseActionCursor=1
DynamicVariables=1
MouseOverAction=!Execute [!RainmeterShowMeter Feed1.Grabber][!RainmeterShowMeter Feed2.Grabber][!RainmeterShowMeter Feed3.Grabber][!RainmeterShowMeter Feed4.Grabber][!RainmeterShowMeter Feed#NO#.Active][!RainmeterShowMeter X][!RainmeterDisableMeasure mShow1][!RainmeterDisableMeasure mShow2][!RainmeterDisableMeasure mShow3][!RainmeterDisableMeasure mShow4][!RainmeterRedraw]

[Gradient]
Meter=IMAGE
MeterStyle=sGradient
MouseOverAction=!Execute [!RainmeterShowMeter Feed1.Grabber][!RainmeterShowMeter Feed2.Grabber][!RainmeterShowMeter Feed3.Grabber][!RainmeterShowMeter Feed4.Grabber][!RainmeterShowMeter Feed#No#.Active][!RainmeterShowMeter X][!RainmeterRedraw]
DynamicVariables=1

[Feed1.Grabber]
Meter=BUTTON
MeterStyle=sButton
ButtonImage=Inactive.png
X=130
ButtonCommand=!Execute [!RainmeterSetVariable NO 1][!RainmeterShowMeter Feed1.Active][!RainmeterHideMeter Feed2.Active][!RainmeterHideMeter Feed3.Active][!RainmeterHideMeter Feed4.Active][!RainmeterDisableMeasure mShow1][!RainmeterDisableMeasure mShow2][!RainmeterDisableMeasure mShow3][!RainmeterDisableMeasure mShow4][!RainmeterRedraw]

[Feed1.Active]
Meter=IMAGE
MeterStyle=sButton
ImageName=Active.png
X=r

[Feed2.Grabber]
Meter=BUTTON
MeterStyle=sButton
ButtonImage=Inactive.png
ButtonCommand=!Execute [!RainmeterSetVariable NO 2][!RainmeterHideMeter Feed1.Active][!RainmeterShowMeter Feed2.Active][!RainmeterHideMeter Feed3.Active][!RainmeterHideMeter Feed4.Active][!RainmeterDisableMeasure mShow1][!RainmeterDisableMeasure mShow2][!RainmeterDisableMeasure mShow3][!RainmeterDisableMeasure mShow4][!RainmeterRedraw]

[Feed2.Active]
Meter=IMAGE
MeterStyle=sButton
ImageName=Active.png
X=r

[Feed3.Grabber]
Meter=BUTTON
MeterStyle=sButton
ButtonImage=Inactive.png
ButtonCommand=!Execute [!RainmeterSetVariable NO 3][!RainmeterHideMeter Feed1.Active][!RainmeterHideMeter Feed2.Active][!RainmeterShowMeter Feed3.Active][!RainmeterHideMeter Feed4.Active][!RainmeterDisableMeasure mShow1][!RainmeterDisableMeasure mShow2][!RainmeterDisableMeasure mShow3][!RainmeterDisableMeasure mShow4][!RainmeterRedraw]

[Feed3.Active]
Meter=IMAGE
MeterStyle=sButton
ImageName=Active.png
X=r

[Feed4.Grabber]
Meter=BUTTON
MeterStyle=sButton
ButtonImage=Inactive.png
ButtonCommand=!Execute [!RainmeterSetVariable NO 4][!RainmeterHideMeter Feed1.Active][!RainmeterHideMeter Feed2.Active][!RainmeterHideMeter Feed3.Active][!RainmeterShowMeter Feed4.Active][!RainmeterDisableMeasure mShow1][!RainmeterDisableMeasure mShow2][!RainmeterDisableMeasure mShow3][!RainmeterDisableMeasure mShow4][!RainmeterRedraw]

[Feed4.Active]
Meter=IMAGE
MeterStyle=sButton
ImageName=Active.png
X=r

[X]
Meter=BUTTON
MeterStyle=sX
Besley
Posts: 5
Joined: December 4th, 2010, 6:16 am

Re: Loading an image

Post by Besley »

Code: Select all

[mImage1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://chart.finance.yahoo.com/z?s=USDJPY%3dX&t=5d&q=&l=&z=l&p=s&a=v&p=s&lang=en-SG&region=SG
UpdateRate=3600
Download=1
DownloadFile=#CURRENTPATH#image.png
this doesnt get the file too,
i see the folder tjhough
Besley
Posts: 5
Joined: December 4th, 2010, 6:16 am

Re: Loading an image

Post by Besley »

okay some sharing

i found that DownloadFile=#CURRENTPATH#image.png is not needed
it already is in the skin's root directory, hence failed downloading
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: Loading an image

Post by kenz0 »

Basically, DownloadFile function allows download only into "DownloadFile" dir.
So DownloadFile dir is a root path, and that is a top lebel, so you don't need to define with absolute path using #CURRENTPATH#.

Try this.

Code: Select all

[mImage1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://chart.finance.yahoo.com/z?s=USDJPY%3dX&t=5d&q=&l=&z=l&p=s&a=v&p=s&lang=en-SG&region=SG
UpdateRate=3600
Download=1
DownloadFile=image.png

[Image]
Meter=IMAGE
MeasureName=mImage1
W=100
H=100
PreserveAspectRatio=1
.
Image