It is currently December 6th, 2022, 2:11 pm

Script problem

Get help with installing and using Rainmeter.
User avatar
JOHAAANNS
Posts: 2
Joined: November 8th, 2022, 2:21 pm

Script problem

Post by JOHAAANNS »

Hi,

Sorry for my poor english.


This script was working perfectly, then overnight without touching anything. It no longer works.
Can you tell me where is the problem?
Thank you for your help.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
DynamicVariables=1
Update=1000
BackgroundMode=2
CodePage=UTF-8
SolidColor=0,0,0,200
BackgroundMargins=0,0,0,0
;W=400
;H=400

[Mediatheque\OpenAgenda]
Active=1
WindowX=1300
WindowY=130

[MeterBackground]
Meter=Image
ImageName=#@#Images\Background.png
X=0
Y=0

[Metadata]
Name=Récupération des infos venant d'Open Agenda
Author=JT
Information=mail
License=Free
Version=1

[Variables]
Item=canonicalUrl":"(.*)".*title":{"fr":"(.*)".*description":{"fr":"(.*)".*image":"(.*)".*range":{"fr":"(.*)","en.*
;Item=.*<h3 class="margin-v-z">(.*)</h3>.*<img class="img-responsive" src="(.*)" width="568" height="213">.*<p>(.*)</p>.*<li><i class="fa fa-clock-o"></i>(.*)</li>


[MeterString]
Meter=String
Text=Pôle Multimédia - Les 5 prochains évènements
FontSize=18
FontColor=255,255,255,255
X=14
Y=18
;W=400
;H=22

[MeasureSite]
Measure=WebParser
URL=https://openagenda.com/agendas/96869629/events.json?oaq%5Btags%5D%5B0%5D=pole-multimedia&lang=fr
RegExp=(?siU)#Item##Item##Item##Item##Item#
Debug=2



; ---------------------------------------
; -----------EVENT #1--------------------
; ---------------------------------------
[MeasureLien1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1

[MeterLien1]
Meter=String
LeftMouseUpAction=[MeasureLien1]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien1
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=160
WR=800
H=50

[MeasureTitle1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=2

[MeterTitle1]
Meter=String
MeasureName=MeasureTitle1
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
;Y postion a partie d'en haut
Y=65 
W=400
H=50


[MeasureDescription1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=3

[MeterDescription1]
Meter=String
MeasureName=MeasureDescription1
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=110
W=400
H=50

[MeasureImage1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=4
Download=1

[MeterImage1]
Meter=Image
MeasureName=MeasureImage1
X=20
Y=70
W=120
;H=100

[MeasureDate1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=5

[MeterDate1]
Meter=String
MeasureName=MeasureDate1
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=160
W=400
H=50

; ---------------------------------------
; -----------EVENT #2--------------------
; ---------------------------------------
[MeasureLien2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=6

[MeterLien2]
Meter=String
LeftMouseUpAction=[MeasureLien2]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien2
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=300
WR=800
H=50

[MeasureTitle2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=7

[MeterTitle2]
Meter=String
MeasureName=MeasureTitle2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=200
W=400
H=50


[MeasureDescription2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=8

[MeterDescription2]
Meter=String
MeasureName=MeasureDescription2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=245
W=400
H=50

[MeasureImage2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=9
Download=1

[MeterImage2]
Meter=Image
MeasureName=MeasureImage2
X=20
Y=200
W=120
;H=100


[MeasureDate2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=10

[MeterDate2]
Meter=String
MeasureName=MeasureDate2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=300
W=400
H=50

; ---------------------------------------
; -----------EVENT #3--------------------
; ---------------------------------------
[MeasureLien3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=11

[MeterLien3]
Meter=String
LeftMouseUpAction=[MeasureLien3]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=440
WR=800
H=50

[MeasureTitle3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=12

[MeterTitle3]
Meter=String
MeasureName=MeasureTitle3
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=350
W=400
H=50


[MeasureDescription3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=12

[MeterDescription3]
Meter=String
MeasureName=MeasureDescription3
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=400
W=400
H=50

[MeasureImage3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=14
Download=1

[MeterImage3]
Meter=Image
MeasureName=MeasureImage3
X=20
Y=350
W=120
;H=100


[MeasureDate3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=15

[MeterDate3]
Meter=String
MeasureName=MeasureDate3
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=440
W=400
H=50

; ---------------------------------------
; -----------EVENT #4--------------------
; ---------------------------------------
[MeasureLien4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=19

[MeterLien4]
Meter=String
LeftMouseUpAction=[MeasureLien4]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=580
WR=800
H=50

[MeasureTitle4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=17

[MeterTitle4]
Meter=String
MeasureName=MeasureTitle4
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=490
W=400
H=50


[MeasureDescription4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=18

[MeterDescription4]
Meter=String
MeasureName=MeasureDescription4
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=535
W=400
H=50

[MeasureImage4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=19
Download=1

[MeterImage4]
Meter=Image
MeasureName=MeasureImage4
X=20
Y=490
W=120
;H=100


[MeasureDate4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=20

[MeterDate4]
Meter=String
MeasureName=MeasureDate4
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=580
W=400
H=50

; ---------------------------------------
; -----------EVENT #5--------------------
; ---------------------------------------
[MeasureLien5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=21

[MeterLien5]
Meter=String
LeftMouseUpAction=[MeasureLien5]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=710
WR=800
H=50

[MeasureTitle5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=22

[MeterTitle5]
Meter=String
MeasureName=MeasureTitle5
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=620
W=400
H=50


[MeasureDescription5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=23

[MeterDescription5]
Meter=String
MeasureName=MeasureDescription5
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=665
W=400
H=50

[MeasureImage5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=24
Download=1

[MeterImage5]
Meter=Image
MeasureName=MeasureImage5
X=20
Y=620
W=120
;H=100


[MeasureDate5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=25

[MeterDate5]
Meter=String
MeasureName=MeasureDate5
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=710
W=400
H=50
User avatar
xenium
Posts: 719
Joined: January 4th, 2018, 9:52 pm

Re: Script problem

Post by xenium »

JOHAAANNS wrote: November 8th, 2022, 2:30 pm Hi,

Sorry for my poor english.


This script was working perfectly, then overnight without touching anything. It no longer works.
Can you tell me where is the problem?
Thank you for your help.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
DynamicVariables=1
Update=1000
BackgroundMode=2
CodePage=UTF-8
SolidColor=0,0,0,200
BackgroundMargins=0,0,0,0
;W=400
;H=400

[Mediatheque\OpenAgenda]
Active=1
WindowX=1300
WindowY=130

[MeterBackground]
Meter=Image
ImageName=#@#Images\Background.png
X=0
Y=0

[Metadata]
Name=Récupération des infos venant d'Open Agenda
Author=JT
Information=mail
License=Free
Version=1

[Variables]
Item=canonicalUrl":"(.*)".*title":{"fr":"(.*)".*description":{"fr":"(.*)".*image":"(.*)".*range":{"fr":"(.*)","en.*
;Item=.*<h3 class="margin-v-z">(.*)</h3>.*<img class="img-responsive" src="(.*)" width="568" height="213">.*<p>(.*)</p>.*<li><i class="fa fa-clock-o"></i>(.*)</li>


[MeterString]
Meter=String
Text=Pôle Multimédia - Les 5 prochains évènements
FontSize=18
FontColor=255,255,255,255
X=14
Y=18
;W=400
;H=22

[MeasureSite]
Measure=WebParser
URL=https://openagenda.com/agendas/96869629/events.json?oaq%5Btags%5D%5B0%5D=pole-multimedia&lang=fr
RegExp=(?siU)#Item##Item##Item##Item##Item#
Debug=2



; ---------------------------------------
; -----------EVENT #1--------------------
; ---------------------------------------
[MeasureLien1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1

[MeterLien1]
Meter=String
LeftMouseUpAction=[MeasureLien1]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien1
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=160
WR=800
H=50

[MeasureTitle1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=2

[MeterTitle1]
Meter=String
MeasureName=MeasureTitle1
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
;Y postion a partie d'en haut
Y=65 
W=400
H=50


[MeasureDescription1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=3

[MeterDescription1]
Meter=String
MeasureName=MeasureDescription1
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=110
W=400
H=50

[MeasureImage1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=4
Download=1

[MeterImage1]
Meter=Image
MeasureName=MeasureImage1
X=20
Y=70
W=120
;H=100

[MeasureDate1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=5

[MeterDate1]
Meter=String
MeasureName=MeasureDate1
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=160
W=400
H=50

; ---------------------------------------
; -----------EVENT #2--------------------
; ---------------------------------------
[MeasureLien2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=6

[MeterLien2]
Meter=String
LeftMouseUpAction=[MeasureLien2]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien2
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=300
WR=800
H=50

[MeasureTitle2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=7

[MeterTitle2]
Meter=String
MeasureName=MeasureTitle2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=200
W=400
H=50


[MeasureDescription2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=8

[MeterDescription2]
Meter=String
MeasureName=MeasureDescription2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=245
W=400
H=50

[MeasureImage2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=9
Download=1

[MeterImage2]
Meter=Image
MeasureName=MeasureImage2
X=20
Y=200
W=120
;H=100


[MeasureDate2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=10

[MeterDate2]
Meter=String
MeasureName=MeasureDate2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=300
W=400
H=50

; ---------------------------------------
; -----------EVENT #3--------------------
; ---------------------------------------
[MeasureLien3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=11

[MeterLien3]
Meter=String
LeftMouseUpAction=[MeasureLien3]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=440
WR=800
H=50

[MeasureTitle3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=12

[MeterTitle3]
Meter=String
MeasureName=MeasureTitle3
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=350
W=400
H=50


[MeasureDescription3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=12

[MeterDescription3]
Meter=String
MeasureName=MeasureDescription3
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=400
W=400
H=50

[MeasureImage3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=14
Download=1

[MeterImage3]
Meter=Image
MeasureName=MeasureImage3
X=20
Y=350
W=120
;H=100


[MeasureDate3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=15

[MeterDate3]
Meter=String
MeasureName=MeasureDate3
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=440
W=400
H=50

; ---------------------------------------
; -----------EVENT #4--------------------
; ---------------------------------------
[MeasureLien4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=19

[MeterLien4]
Meter=String
LeftMouseUpAction=[MeasureLien4]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=580
WR=800
H=50

[MeasureTitle4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=17

[MeterTitle4]
Meter=String
MeasureName=MeasureTitle4
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=490
W=400
H=50


[MeasureDescription4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=18

[MeterDescription4]
Meter=String
MeasureName=MeasureDescription4
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=535
W=400
H=50

[MeasureImage4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=19
Download=1

[MeterImage4]
Meter=Image
MeasureName=MeasureImage4
X=20
Y=490
W=120
;H=100


[MeasureDate4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=20

[MeterDate4]
Meter=String
MeasureName=MeasureDate4
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=580
W=400
H=50

; ---------------------------------------
; -----------EVENT #5--------------------
; ---------------------------------------
[MeasureLien5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=21

[MeterLien5]
Meter=String
LeftMouseUpAction=[MeasureLien5]
Text="Pour plus d'informations, cliquez ici."
;MeasureName=MeasureLien2
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=251,255,0
AntiAlias=1
Padding=5,5,5,5
X=370
Y=710
WR=800
H=50

[MeasureTitle5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=22

[MeterTitle5]
Meter=String
MeasureName=MeasureTitle5
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=620
W=400
H=50


[MeasureDescription5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=23

[MeterDescription5]
Meter=String
MeasureName=MeasureDescription5
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=665
W=400
H=50

[MeasureImage5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=24
Download=1

[MeterImage5]
Meter=Image
MeasureName=MeasureImage5
X=20
Y=620
W=120
;H=100


[MeasureDate5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=25

[MeterDate5]
Meter=String
MeasureName=MeasureDate5
StringEffect=SHADOW
FontEffectColor=0,0,0
FontSize=9
FontColor=255,255,255,255
AntiAlias=1
Padding=5,5,5,5
ClipString=1
X=150
Y=710
W=400
H=50
Your skin is made to display 5 items, but there are only 3 items on the website.
Because of this, the entire regular expression will fail and no results will be returned to the WebParser measure.
This can be solved by using Lookahead Assertion :
https://docs.rainmeter.net/tips/webparser-lookahead-assertions-in-regexp/

In the [Variables] section, replace the Item variable with this:

Code: Select all

[Variables]
Item=(?(?=.*canonicalUrl").*:"(.*)".*title":{"fr":"(.*)".*description":{"fr":"(.*)".*image":"(.*)".*range":{"fr":"(.*)","en.*)
Then refresh the skin
User avatar
JOHAAANNS
Posts: 2
Joined: November 8th, 2022, 2:21 pm

Re: Script problem

Post by JOHAAANNS »

Thx so much !
i dont see that !
It's work fine...!!
Thx for your time ;)
User avatar
xenium
Posts: 719
Joined: January 4th, 2018, 9:52 pm

Re: Script problem

Post by xenium »

JOHAAANNS wrote: November 8th, 2022, 3:58 pm Thx so much !
i dont see that !
It's work fine...!!
Thx for your time ;)
You're welcome!