It is currently October 1st, 2022, 8:01 am

5day weather not working...

Get help with creating, editing & fixing problems with skins
User avatar
daenal
Posts: 7
Joined: October 23rd, 2016, 2:10 pm

5day weather not working...

Post by daenal »

I have seen other discussions on getting weather to work, however, mine doesn't use the local end it uses a five day forecast and it doesn't seem to be working at all. I have included the base code that shows the weather part, but not sure if I should include the whole code or not. My skin is the Alice-Reworked. Any suggestions? Any help would be appreciated. Thanks.

Code: Select all

[Variables]
@Include=#@#Configs\DefaultVariables.inc
@Include2=#@#Configs\CommonStyles.inc
@Include3=#@#Configs\UserVariables.inc
WeatherIcons=#@#images\weather\wIcons\
5dayForecast=http://wxdata.weather.com/wxdata/weather/5day/#WeatherCode#
WindDirections="VAR":"S","N/A":"","CALM":"Calm","S":"South","N":"North","E":"East","W":"West","NorthNorthWest":"NNW","WestNorthWest":"WNW","WestSouthWest":"WSW","SouthSouthWest":"SSW","SouthSouthEast":"SSE","EastSouthEast":"ESE","EastNorthEast":"ENE","NorthNorthEast":"NNE","SouthEast":"SE","SouthWest":"SW","NorthEast":"NE","NorthWest":"NW"
UpdateWeather=3600
PanelWidth=304
RPX=178
RPY=15
FIconX=65
FX1=146
F1Y=16
F2Y=115
F3Y=218
IconSize=60
Yspace=16
TxtColor=a3a193
TxtColor2=cecbbb

[sText]
FontFace=Puritan
FontSize=9
FontColor=#TxtColor#
AntiAlias=1

;===  [  measures  ]  
[mGoGetWeather]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://wxdata.weather.com/wxdata/weather/5day/#WeatherCode#?cc=*&unit=#Units#&dayf=3
 RegExp="(?siU).*<head>.*<ut>(.*)</ut>.*<us>(.*)</us>.*<loc id="(.*)">.*<dnam>(.*)</dnam>.*<tm>(.*)</tm>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<t>(.*)</t>.*<icon>(.*)</icon>.*<bar>.*<r>(.*)</r>.*<d>(.*)</d>.*<wind>.*<s>(.*)</s>.*<d>(.*)</d>.*<t>(.*)</t>.*<hmid>(.*)</hmid>.*<uv>.*<i>(.*)</i>.*<t>(.*)</t>.*</uv>.*<dayf>.*<hi>(.*)</hi>.*<low>(.*)</low>.*<part.*=(.*)>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<wind>.*<s>(.*)</s>.*<d>(.*)</d>.*<t>(.*)</t>.*<bt(.*)</bt>.*<ppcp>(.*)</ppcp>.*<hmid>(.*)</hmid>.*<part p.*=(.*)>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<wind>.*<s>(.*)</s>.*<gust>(.*)</gust>.*<d>(.*)</d>.*<t>(.*)</t>.*<bt>(.*)</bt>.*<ppcp>(.*)</ppcp>.*<hmid>(.*)</hmid>.*<day d="1" t="(.*)" dt.*<hi>(.*)</hi>.*<low>(.*)</low>.*<part p="d">.*<icon>(.*)</icon>.*<t>(.*)</t>.*<wind>.*<s>(.*)</s>.*<t>(.*)</t>.*<ppcp>(.*)</ppcp>.*</day>.*<day d="2" t="(.*)" dt.*<hi>(.*)</hi>.*<low>(.*)</low>.*<part p="d">.*<icon>(.*)</icon>.*<t>(.*)</t>.*<s>(.*)</s>.*<t>(.*)</t>.*<ppcp>(.*)</ppcp>.*</day>"
 StringIndex=4
 FinishAction=[!ShowMeterGroup Now] [!EnableMeasure mLuaScript] 
 UpdateRate=#UpdateWeather#
“Whales are just obese sea dragons!”
User avatar
jsmorley
Developer
Posts: 22547
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 5day weather not working...

Post by jsmorley »

Did it work and then stop working, or never worked with this code?
User avatar
daenal
Posts: 7
Joined: October 23rd, 2016, 2:10 pm

Re: 5day weather not working...

Post by daenal »

Sorry. It was working and now it isn't. I should mention also that it is the whole skin, not just the 5 day part, I realize the title is confusing now. Just wanted to make sure there was a difference between what I was reading and this one as it looks so different. I also found another link in part of the code later on. I am including it here. I tried changing this one to match the code in the prior section of the code to read

Code: Select all

http://wxdata.weather.com/wxdata/weather/right-now/#WeatherCode#
And that didn't work either, so I have no idea as I am not a coder, just can follow instructions to make it work. :)

Code: Select all

;=== [ meters ]	================================================
[MtBackground1]
Meter=IMAGE
ImageName=#@#images\weather\wb10.png
X=(#RPX#-10)
Y=(#RPY#-10)
UpdateDivider=-1

;=== [ Current Weather ]
[MtCurrentIcon]
Meter=IMAGE
Path=#WeatherIcons#
MeasureName=mIconCurrent
X=(#RPX#+66)
Y=(#RPY#+72)
H=(#IconSize#+4)
W=(#IconSize#+4)
ToolTipIcon=#@#Images\Weather\Wicons\TWC-L.ico
ToolTipType=1
ToolTipTitle=[mGoGetWeather]
ToolTipText="[mDescriptionNow]#CRLF#Temperature:  [mTempNow][mTempUnits] (feels like [mFeelsLike][mTempUnits])#CRLF#Humidity:   [mHumidityNow]%#CRLF#Wind: [mWindDirection] at [mWindSpeed] [mWindSpeedUnits]#CRLF#UV level: [mCurrentUV] [mUVlevel]"
LeftMouseUpAction=http://www.weather.com/weather/right-now/#WeatherCode#  
AntiAlias=1
DynamicVariables=1
Group=Now
“Whales are just obese sea dragons!”
User avatar
balala
Rainmeter Sage
Posts: 14568
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: 5day weather not working...

Post by balala »

The Url option of the [mGoGetWeather] is wrong. Replace the existing Url=http://wxdata.weather.com/wxdata/weather/5day/#WeatherCode#?cc=*&unit=#Units#&dayf=3 option with Url=http://wxdata.weather.com/wxdata/weather/local/#WeatherCode#?cc=*&unit=#Units#&dayf=5. Also make sure you have the WeatherCode and Units variables defined in one of the included files (@Resoruces\Configs\DefaultVariables.inc, @Resources\Configs\CommonStyles.inc or @Resources\Configs\UserVariables.inc, most probably in the last one).
User avatar
daenal
Posts: 7
Joined: October 23rd, 2016, 2:10 pm

Re: 5day weather not working...

Post by daenal »

Ummm... It is very weird as I didn't change a thing, but it started working all the sudden. Thanks anyways all. My son just informed me it is only sometimes non-functional. He said usually overnight it doesn't work and I didn't realize it. Odd. :???: Sorry all unless anyone has any idea why it would only work some of the time... Thanks anyways.
“Whales are just obese sea dragons!”
User avatar
jsmorley
Developer
Posts: 22547
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 5day weather not working...

Post by jsmorley »

If a WebParser-based skin stops working suddenly, often a restart of Rainmeter can correct it.

You might want to check the value of the #UpdateWeather# variable you are using in UpdateRate=#UpdateWeather#, that should be set to 600 to ensure you are not hammering WebParser with calls to the weather feed. An UpdateRate of 600 (the default) is 10 minutes when the skin Update is the default 1000, and 10 minutes is fine for a weather feed. Most of them only update their feeds every 10 minutes anyway. If you are updating the feed very often, like every few seconds, It can cause issues.

WebParser can get its knickers in a knot and hang when it is asked to go out to a site and get information when it hasn't yet competed the previous request. These calls are not "stacked up", but rather the second call "kills" the first one with extreme prejudice, and if you do that repeatedly in a short period of time, the underlying Internet Explorer routines can get hung up. Restarting Rainmeter will clean up any hung WebParser.dll processes, and all will be well, but some care should be taken with UpdateRate to ensure you are not stressing WebParser's ability to "keep up".

Just for information's sake, the underlying Internet Explorer routines can take anywhere from 20-30 seconds to "give up" when trying to access a site that for some reason is "slow" at any given time. Say for instance there is a DDoS attack going on from some hackers in Russia or North Korea... If you are accessing a site every 10 seconds (generally a bad idea) and the site is slow, you might well start repeatedly killing and starting WebParser processes to the point where it just chews off its own arm trying to escape. That is why it is good to keep UpdateRate to a number that is large enough to ensure that things don't get ahead of themselves, while small enough to get the information you need in a timely fashion. Every 10 minutes is going to be about right for most RSS and weather feeds, and UpdateRate should only really be set at all (overriding the default 600) if you are sure you need to. I would almost never go lower than once a minute for any remote site.

https://docs.rainmeter.net/manual/plugins/webparser/#UpdateRate
User avatar
jsmorley
Developer
Posts: 22547
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 5day weather not working...

Post by jsmorley »

Here is a little program that will automatically restart Rainmeter for you...

Just unzip this and run it.
RestartRainmeter.zip
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 14568
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: 5day weather not working...

Post by balala »

daenal wrote:Ummm... It is very weird as I didn't change a thing, but it started working all the sudden. Thanks anyways all. My son just informed me it is only sometimes non-functional. He said usually overnight it doesn't work and I didn't realize it. Odd. :???: Sorry all unless anyone has any idea why it would only work some of the time... Thanks anyways.
To be honest, I doubt it started working with the original Url option (Url=http://wxdata.weather.com/wxdata/weather/5day/#WeatherCode#?cc=*&unit=#Units#&dayf=3), but you know...
User avatar
daenal
Posts: 7
Joined: October 23rd, 2016, 2:10 pm

Re: 5day weather not working...

Post by daenal »

JSmorley, Thanks. I double checked and the update is set to 3600, so that should be good and I will try the restart program. I had refreshed it when it started working again, but this might keep it going over night. Thanks.

Balala, Considering that 3 is still in the code as I didn't change it to 5 at all, it is working just as it was in the original code, but thanks for calling me a liar. Appreciate it. It appears that part of the code is intentional as it has a 3 day forecast function that when you click it allows you to see a 3 day forecast, but since the weather service doesn't have a three day forecast, it has to grab the 5day and only shows three. When I do change it to 5 as you suggest, the 3day forecast breaks, but again, thanks for basically calling me a liar.
“Whales are just obese sea dragons!”
User avatar
jsmorley
Developer
Posts: 22547
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 5day weather not working...

Post by jsmorley »

daenal wrote:JSmorley, Thanks. I double checked and the update is set to 3600, so that should be good and I will try the restart program. I had refreshed it when it started working again, but this might keep it going over night. Thanks.

Balala, Considering that 3 is still in the code as I didn't change it to 5 at all, it is working just as it was in the original code, but thanks for calling me a liar. Appreciate it. It appears that part of the code is intentional as it has a 3 day forecast function that when you click it allows you to see a 3 day forecast, but since the weather service doesn't have a three day forecast, it has to grab the 5day and only shows three. When I do change it to 5 as you suggest, the 3day forecast breaks, but again, thanks for basically calling me a liar.
Easy... Balala is trying to help.