It is currently April 19th, 2024, 6:01 pm

Rainmeter WebPaser all Image Files

Get help with creating, editing & fixing problems with skins
User avatar
Skyayashane
Posts: 7
Joined: August 2nd, 2017, 12:22 pm

Rainmeter WebPaser all Image Files

Post by Skyayashane »

Hi to all, i have some problems regarding in WebParser Plugins. i want to update all my image folder thru internet site.
https://paulalbertcomputershop.000webhostapp.com/Launcher/Slide1/ -- this is folder in my domain contains "*jpg" files
want to change it this line where the PathName=#URL#
is this possible to do... in WebParser

Code: Select all

[Variables]
Path1=Launcher Update Image\Slide1

[RandomImage]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName=#Path1# ---------- change to my domain folder
FileFilter=*.jpg;*.jpeg;*.gif;*.bmp;*.png
Subfolders=1

[Image]
MeasureName=RandomImage
Meter=IMAGE
X = 700
Y = 140
W = 345
H = 330

[Refresh1]
Meter=IMAGE
X = 700
Y = 140
ImageName=new.png
HIdden = 1

[Refresh2]
Meter=IMAGE
X = 700
Y = 140
ImageName=new.png
Hidden = 1

[Refresh]
Meter=IMAGE
X = 700
Y = 140
W=650
SolidColor=255, 0, 0, 0
MouseOverAction=!Execute [!RainmeterShowMeter Refresh1][!RainmeterRedraw]
LeftMouseDownAction=!Execute [!RainmeterShowMeter Refresh2][!RainmeterRedraw]
LeftMouseupAction=!Execute [!RainmeterHideMeter Refresh2][!RainmeterRedraw]
MouseLeaveAction=!execute [!RainmeterHideMeter Refresh1][!RainmeterHideMeter Refresh2][!RainmeterRedraw]
but this is only i can do.. single load

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=https://paulalbertcomputershop.000webhostapp.com/Launcher/Slide1/1.jpg
Download=1

[MeterImage]
Meter=Image
MeasureName=MeasureImage
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter WebPaser all Image Files

Post by jsmorley »

I don't think there is going to be an easy, or even perfectly reliable way to do what you want.

First off, the Quote plugin likely won't help at all. It is based on opening a drive / folder structure in Windows, and selecting a random file from a folder. The only way I think that "might" work is if you set up a public FTP server on that domain, and then map a drive letter to that FTP server / directory in Windows. Then you probably could, although I haven't tested, access those files using Quote plugin.

The other approach would be to get the all the HTML returned from https://paulalbertcomputershop.000webhostapp.com/Launcher/Slide1/ with WebParser. Then using Lua with that result from WebParser, parse those image links into a table (array) and select one random image from that table. Then have the Lua tell WebParser to download that image.

Keep in mind, WebParsr is not a web browser. At the end of the day, it is a text parser. It connects to a resource (web site, local text file) and parses whatever text (HTML in the case of a web site) is returned, looking for patterns. It's always just text. WebParser doesn't know or care about links or directories or files or images or anything else. It just goes to a resource and gets whatever text is returned. How you interpret that text, and what you do with it, is up to you.

The reason I think you will have to use Lua for this is that you can't know how many images there will be listed on that page at any given time. So you need to use Lua to "count" the images, so you know how many to parse out of the HTML into the table, and how big to make the highest random number you select.

Note that WebParser will not be able in any way to "follow" any links to child or parent directories in that page. You can count and then get all the links to image files returned by that single URL, but trying to turn this into a "file manager" for an HTML listing of a remote server file structure would be so complicated that it would border on impractical. Rainmeter is not the right tool for that job.

While I think this would be possible, it won't be trivial... If you want to explore it, I'm willing to lend a hand, but strap in. Bring your lunch.

I think to get started, you might want to add some more image files there, ones that don't have that consistent "Image1.jpg" naming scheme, add some sub-folders in random places alphabetically, add some files that aren't images. The first thing we would need to know is if we can consistently and reliably count and get links to all the image files listed. It won't do to build an approach that is based on the "best case", only to find it falls apart when things get more complicated.