Page 1 of 2

Weather Underground RegExp

Posted: July 11th, 2017, 4:15 pm
by SCR
I'm a long time lurker and try to figure things out on my own but this error in the log file is beyond me to resolve.

Due to the intermittent problems with the weather.com data disappearing in my location I'm moving on to Weather Underground's API to a neighbors Personal Weather Station.

My actual weather skin is rather large so TestWuWeather is just an example to demonstrate the issue. If required I will pack up TestWuWeather including the icons, once I figure out how to do it.

The following appears in the log twice when the skin is loaded or refreshed.
Error: TestWuWeather\TestWuWeather.ini C:\Users\SCR\Documents\Rainmeter\Skins\TestWuWeather\@Resources\Images\WuWeatherIcons\.gif

After the initial loading of the .ini the skin works as expected, no additional errors on Update.

I have come to the conclusion, right or wrong, that it has to do with the way I have constructed the RegExp.

RegExp is difficult for me to say the least. Any help eliminating the errors would be appreciated.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=TestWuWeather
Author=SCR
Information=TestWuWeather - Powered by Weather Underground
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
FontName=Segoe UI
FontColor=168,168,168,220

;=============== WeatherUnderground API ID Required.
WuIdAPI=
;=============================
;========== Measures ==========
[WuParent]
Measure=Plugin
Plugin=WebParser
URL=http://api.wunderground.com/api/#WuIdAPI#/conditions/forecast/astronomy/q/pws:KNYCLIFT20.xml
RegExp=(?siU).*<observation_time>(.*)</observation_time>.*<icon>(.*)</icon>
ForceReload=1
FinishAction=[!EnableMeasureGroup WuWeatherTest][!UpdateMeasureGroup WuWeatherTest][!UpdateMeter *][!ReDraw]

[WuMeasureLastUpdate]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[WuParent]
StringIndex=1
Group=WuWeatherTest
Disabled=1

[WuMeasureCurrentIcon]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[WuParent]
StringIndex=2
Group=WuWeatherTest
Disabled=1


;========== Meters ===========
[WuMeterLastUpdate]
Meter=String
MeasureName=WuMeasureLastUpdate
X=0
Y=0
FontFace=#FontName#
FontSize=9
FontColor=#FontColor#
StringAlign=Left
AntiAlias=1
Text=%1

[MeterCurrentIcon]
MeasureName=WuMeasureCurrentIcon
Meter=Image
ImageName=#@#Images\WuWeatherIcons\%1.gif
PreserveAspectRatio=1
AntiAlias=1
X=0
Y=20
W=46
Edited Code to make corrections per Free Raider

Re: Weather Underground RegExp

Posted: July 11th, 2017, 4:23 pm
by FreeRaider
The first: Try this

Code: Select all

FinishAction=[!EnableMeasureGroup WuWeatherTest][!UpdateMeasureGroup WuWeatherTest][!UpdateMeter *][!ReDraw]
The second: correct [WuMeterLastUpdate with [WuMeterLastUpdate]

Re: Weather Underground RegExp

Posted: July 11th, 2017, 5:08 pm
by SCR
FreeRaider wrote:The first: Try this

Code: Select all

FinishAction=[!EnableMeasureGroup WuWeatherTest][!UpdateMeasureGroup WuWeatherTest][!UpdateMeter *][!ReDraw]
The second: correct [WuMeterLastUpdate with [WuMeterLastUpdate]
Thanks for the reply Free Raider. Unfortunately adding both did not remove the .gif errors from the log file. I should have had both in there.

Re: Weather Underground RegExp

Posted: July 11th, 2017, 5:22 pm
by FreeRaider
SCR wrote:If required I will pack up TestWuWeather including the icons
please do it.

Re: Weather Underground RegExp

Posted: July 11th, 2017, 5:39 pm
by SCR
FreeRaider wrote:please do it.
I hope this worked

Re: Weather Underground RegExp

Posted: July 11th, 2017, 7:39 pm
by FreeRaider
Ok I think that I solved your problem:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=Weather
Author=SCR
Information=WuWeatherTest - Powered by Weather Underground
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
FontName=Segoe UI
FontColor=168,168,168,220

;WeatherUnderground API ID Required.
WuIdAPI=

;========== Measures ==========
[WuParent]
Measure=Plugin
Plugin=WebParser
URL=http://api.wunderground.com/api/#WuIdAPI#/conditions/forecast/astronomy/q/pws:KNYCLIFT20.xml
RegExp=(?siU).*<observation_time>(.*)</observation_time>.*<icon>(.*)</icon>
ForceReload=1
FinishAction=[!EnableMeasureGroup WuWeatherTest][!UpdateMeasureGroup WuWeatherTest][!ShowMeter MeterCurrentIcon]
UpdateRate=600
DynamicVariables=1

[WuMeasureLastUpdate]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[WuParent]
StringIndex=1
Group=WuWeatherTest
Disabled=1

[WuMeasureCurrentIcon]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[WuParent]
StringIndex=2
Group=WuWeatherTest
Disabled=1
OnUpdateAction=[!SetOption MeterCurrentIcon ImageName "#@#Images\WuWeatherIcons\[WuMeasureCurrentIcon].gif"]

;========== Meters ===========
[WuMeterLastUpdate]
Meter=String
MeasureName=WuMeasureLastUpdate
X=0
Y=0
FontFace=#FontName#
FontSize=9
FontColor=#FontColor#
StringAlign=Left
AntiAlias=1
Text=%1

[MeterCurrentIcon]
Meter=Image
PreserveAspectRatio=1
AntiAlias=1
X=0
Y=20
W=46
Hidden=1

Re: Weather Underground RegExp

Posted: July 11th, 2017, 8:30 pm
by SCR
Thanks Free Raider it did indeed solve the problem. I'm not sure why thou O.O

I will have about 16 icons that will show at different times in the WuWeather skin I'm creating. Each shows the error twice on load or refresh. That's a lot of errors.

I assume I will have to edit all the icon Display meters in a like matter. Is this a correct assumption

On Edit: Make that 16 icons

Re: Weather Underground RegExp

Posted: July 11th, 2017, 8:49 pm
by FreeRaider
Glad to help.

Post Scriptum: For any further help / information, do not hesitate to ask.

Re: Weather Underground RegExp

Posted: July 11th, 2017, 9:10 pm
by SCR
FreeRaider wrote:Glad to help.

Post Scriptum: For any further help / information, do not hesitate to ask.
I really appreciate your time and your patience to help me...

If you're curious here's a screenshot of my project so far.

Re: Weather Underground RegExp

Posted: July 11th, 2017, 9:21 pm
by FreeRaider
Amazing! :o