It is currently May 27th, 2020, 2:48 am

RegExp - Picture

Help with creating, editing & fixing problems with skins
Blackjack
Posts: 3
Joined: May 9th, 2020, 10:53 pm

RegExp - Picture

Post by Blackjack »

Hello,

i want to do a own Rainmeterweatherskin, but i get a failure reponse with this RegExp-Line.

This is the Originalline:

[FontAwesome]<img src="https://cs3.wettercomassets.com/wcomv5/images/icons/weather/n_1.svg" data-target-size="medium/small" data-target-variant="" alt="leicht bewölkt" title="überwiegend blauer Himmel, 1/8 bis 3/8 des Himmels sind mit Wolken bedeckt">[/FontAwesome]

I want this icon [FontAwesome]"https://cs3.wettercomassets.com/wcomv5/images/icons/weather/n_1.svg"[/FontAwesome]

I do: [FontAwesome]<img src="(.*)" data-target-size="medium/small" data-target-variant="" alt="leicht bewölkt" title="überwiegend blauer Himmel, 1/8 bis 3/8 des Himmels sind mit Wolken bedeckt">[/FontAwesome]

How i can do that?

And a another question. Can I use the Webparser.dll Plugin? Is it still supportet?
User avatar
jsmorley
Developer
Posts: 20650
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RegExp - Picture

Post by jsmorley »

What is the URL to the site where this string containing the location of the icon is found?
mak_kawa
Posts: 644
Joined: December 30th, 2015, 9:47 am

Re: RegExp - Picture

Post by mak_kawa »

Hi Blackjack

I don't know the target URL, so I tried with file saved from your Originalline. Following test code does work.
Untitled-1.png

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=192,192,192,192

[mGetPath]
Measure=WebParser
URL=File://(target data path)
RegExp=(?siU).*<img src="(.*)".*
StringIndex=1

[MeterPath]
Meter=String
MeasureName=mGetPath
X=5
Y=5
W=300
H=30
ClipString=1
Text=%1
Ps. Webparser.dll plugin is now included in Rainmeter as a Measure. So, its usage is as above.
You do not have the required permissions to view the files attached to this post.
mak_kawa
Posts: 644
Joined: December 30th, 2015, 9:47 am

Re: RegExp - Picture

Post by mak_kawa »

Sorry, my above post is really not enough. Of course, your target html must includes multiple <img src=...please ignore my post.
User avatar
jsmorley
Developer
Posts: 20650
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RegExp - Picture

Post by jsmorley »

Yeah, we need the correct source URL to be able to help much.
Blackjack
Posts: 3
Joined: May 9th, 2020, 10:53 pm

Re: RegExp - Picture

Post by Blackjack »

User avatar
jsmorley
Developer
Posts: 20650
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RegExp - Picture

Post by jsmorley »

The trouble is that there are a lot of places in the source that look like that. How do we know when we have the right one?
User avatar
Yincognito
Posts: 1639
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RegExp - Picture

Post by Yincognito »

Blackjack wrote:
May 10th, 2020, 1:29 am
Hi,

https://www.wetter.com/deutschland/dortmund/DE0002221.html

that is the source URL :D
This will let you browse the weekdays in the source URL, to display their dates and their associated image URLs on left clicking the mouse:

Code: Select all

[Variables]
TabTag=.*<a data-label="VHSTabTag_\d+".*>.*<div>\s*?(.*)\s*?</div>.*<img src=".*".*data-single-src="(.*)".*</a>.*
TabTag16=.*<a data-label="VHSTabTag_16".*>.*</a>.*
NavigationGrid=.*<div class="\[ forecast-navigation-grid \]">#TabTag##TabTag##TabTag##TabTag##TabTag##TabTag##TabTag##TabTag16#</div>.*
SIndex=1

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

[MeasureData]
Measure=WebParser
URL=https://www.wetter.com/deutschland/dortmund/DE0002221.html
RegExp=(?siU)#NavigationGrid#.*<script src=".*">.*
UpdateRate=600
StringIndex=#SIndex#
DynamicVariables=1

[MeterData]
Meter=String
MeasureName=MeasureData
FontFace=Consolas
FontColor=255,255,255,255
FontSize=16
AntiAlias=1
Text=%1
LeftMouseUpAction=[!SetVariable SIndex ((#SIndex#>=7*2)?(1):(#SIndex#+1))][!CommandMeasure MeasureData Update][!UpdateMeter MeterData][!Redraw]
DynamicVariables=1
If by any chance you want to display the actual images (and not their URLs), this can be done like here, but according to the manual, the SVG format is not among the supported image types, so it'll probably be a dead end.
Blackjack
Posts: 3
Joined: May 9th, 2020, 10:53 pm

Re: RegExp - Picture

Post by Blackjack »

Thanks to all :D

I thought I understood how Webharser worked :???: :D

My first idea was the Rainmeter Skin from Geentel (https://www.deviantart.com/quantumfoam1/art/Genteel-424854440) to use. But that didnt worked. Then I read the tutorials and looked at other skins. It's harder than I thought. Haha. Thanks again.