It is currently April 23rd, 2024, 6:58 am

Sample of Download=1 issue

Report bugs with the Rainmeter application and suggest features.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Sample of Download=1 issue

Post by jsmorley »

Here is the code which doesn't work:

Code: Select all

[MeasureDL]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=http://forum.rainmeter.net/
RegExp="(?siU)id="logo"><img src="(.*)"/>.*"
debug=1

[MeasureText]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=[MeasureDL]
StringIndex=1
debug=1

[MeterText]
Meter=STRING
MeasureName=MeasureText
H=20
W=400
X=0
Y=0
FontSize=12
Prefix="Result: "

[MeasureIMG]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=[MeasureDL]
StringIndex=1
Download=1
debug=1

[MeterImage]
Meter=IMAGE
MeasureName=MeasureIMG
H=60
W=70

;http://forum.rainmeter.net/styles/saphic/imageset/site_logo.png
;<a href="./index.php" title="Board index" id="logo"><img src="./styles/saphic/imageset/site_logo.png"/></a>
and the debug log:

Code: Select all

DEBUG: (00:10:58.391) Refreshing (Name: "Image" Ini: "ImageOld.ini")
DEBUG: (00:10:58.422) WebParser: Fetching URL: http://forum.rainmeter.net/
DEBUG: (00:10:59.016) WebParser: Finished URL: http://forum.rainmeter.net/
DEBUG: (00:10:59.016) WebParser: (Index  0) id="logo"><img src="./styles/saphic/imageset/site_logo.png"/>
DEBUG: (00:10:59.016) WebParser: (Index  1) ./styles/saphic/imageset/site_logo.png
DEBUG: (00:10:59.016) WebParser: Downloading url ./styles/saphic/imageset/site_logo.png to C:\Users\JEFFRE~1\AppData\Local\Temp\Rainmeter-Cache\site_logo.png
DEBUG: (00:10:59.016) WebParser: Download failed: ./styles/saphic/imageset/site_logo.png
User avatar
GhostMatrix
Rainmeter Sage
Posts: 141
Joined: April 18th, 2009, 8:26 pm
Location: Montreal, Quebec, Canada 45.5658°N, 73.5898°W UTC -5

Re: Sample of Download=1 issue

Post by GhostMatrix »

@ jsmorley

I think that you forgot to put http://forum.rainmeter.net/ in front of [MeasureDL]

[MeasureIMG]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=http://forum.rainmeter.net/[MeasureDL]
StringIndex=1
Download=1

it work well ...

GM
If at first you don't succeed; call it version 0.1

Image
User avatar
gschoppe
Developer
Posts: 93
Joined: April 26th, 2009, 8:30 pm
Location: St Johnsbury, VT

Re: Sample of Download=1 issue

Post by gschoppe »

sorry to confuse things... I asked for test code for the original issue, so I could see if there was a better way of getting around it...

... it appears there may not be
Image
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Sample of Download=1 issue

Post by jsmorley »

GhostMatrix wrote:@ jsmorley

I think that you forgot to put http://forum.rainmeter.net/ in front of [MeasureDL]

[MeasureIMG]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=http://forum.rainmeter.net/[MeasureDL]
StringIndex=1
Download=1

it work well ...

GM
Yes, we did that on purpose, as gschoppe was looking at the issue to see if it could be made more easy in code instead of having to hard code the URL on the front of the download measure. Just testing.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Sample of Download=1 issue

Post by jsmorley »

By the way gschoppe...

We discussed on irc last night about using a .ico file as an image in a skin. It does work, and the reason I believe is that breakpoint stepping through the code I see that Rainmeter opens a handle to "C:\Windows\System32\WindowsCodecs.dll" when it initializes, and I suspect that "WindowsCodecs.dll" will let Rainmeter use just about any of the common image types.

I tried .tif and .pcx and they work too..

Probably never going to run into much other than:

bmp
png
jpg
gif
ico (favicons)

on the web, things like .tif (and really .bmp too for that matter) are just stupid to use on a web site due to the file size, and nobody has used pcx or pic or other older formats for years. Still, nice to know, in case you wanted a skin to display "raw" images from your digital camera in tiff format.
sgtevmckay

Re: Sample of Download=1 issue

Post by sgtevmckay »

jsmorley wrote: on the web, things like .tif (and really .bmp too for that matter) are just stupid to use on a web site due to the file size, and nobody has used pcx or pic or other older formats for years. Still, nice to know, in case you wanted a skin to display "raw" images from your digital camera in tiff format.
Agreed
But this is still commonly happening.
A lot of photographic sites, and new web builders will go with what they know.
HiRes gallery sites will also utilize lossless or close to lossless image formats.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Sample of Download=1 issue

Post by jsmorley »

sgtevmckay wrote: Agreed
But this is still commonly happening.
A lot of photographic sites, and new web builders will go with what they know.
HiRes gallery sites will also utilize lossless or close to lossless image formats.
True.. There is no end to the stupidity on the web. A photo gallery (hi-res or not) which actually displays a 5Meg .tif file over HTML instead of displaying a 200k high quality .jpg version and offering a download link for the .tif file just hates its users. A page full of 800x600 .tif images would probably take 15 minutes to load in your browser.

But it's good to know that Rainmeter will handle lots of image formats. You never know what you are going to run into.