It is currently October 19th, 2021, 2:35 pm

Weather Underground RegExp

Help with creating, editing & fixing problems with skins
SCR
Posts: 59
Joined: April 15th, 2015, 11:13 pm

Weather Underground RegExp

Post 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
Last edited by SCR on July 12th, 2017, 10:58 am, edited 2 times in total.
User avatar
FreeRaider
Posts: 816
Joined: November 20th, 2012, 11:58 pm

Re: Weather Underground RegExp

Post by FreeRaider »

The first: Try this

Code: Select all

FinishAction=[!EnableMeasureGroup WuWeatherTest][!UpdateMeasureGroup WuWeatherTest][!UpdateMeter *][!ReDraw]
The second: correct [WuMeterLastUpdate with [WuMeterLastUpdate]
SCR
Posts: 59
Joined: April 15th, 2015, 11:13 pm

Re: Weather Underground RegExp

Post 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.
User avatar
FreeRaider
Posts: 816
Joined: November 20th, 2012, 11:58 pm

Re: Weather Underground RegExp

Post by FreeRaider »

SCR wrote:If required I will pack up TestWuWeather including the icons
please do it.
SCR
Posts: 59
Joined: April 15th, 2015, 11:13 pm

Re: Weather Underground RegExp

Post by SCR »

FreeRaider wrote:please do it.
I hope this worked
You do not have the required permissions to view the files attached to this post.
User avatar
FreeRaider
Posts: 816
Joined: November 20th, 2012, 11:58 pm

Re: Weather Underground RegExp

Post 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
SCR
Posts: 59
Joined: April 15th, 2015, 11:13 pm

Re: Weather Underground RegExp

Post 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
User avatar
FreeRaider
Posts: 816
Joined: November 20th, 2012, 11:58 pm

Re: Weather Underground RegExp

Post by FreeRaider »

Glad to help.

Post Scriptum: For any further help / information, do not hesitate to ask.
SCR
Posts: 59
Joined: April 15th, 2015, 11:13 pm

Re: Weather Underground RegExp

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
FreeRaider
Posts: 816
Joined: November 20th, 2012, 11:58 pm

Re: Weather Underground RegExp

Post by FreeRaider »

Amazing! :o