It is currently March 28th, 2024, 3:04 pm

[Solved] Weather Skin help

Get help with creating, editing & fixing problems with skins
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: [Solved] Weather Skin help

Post by CyberTheWorm »

Nice, did not know about that. Anyway I simplified my code.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]


[Variables]
; LocationCode can be obtained at http://wxdata.weather.com/wxdata/search/search?where=YourCityName
LocationCode=CAXX0485

; UnitOfMeasure can be "i" (Imperial / Fahrenheit) or "m" (Metric / Celsius)
UnitOfMeasure=m

; Number of days to return in the feed.(1-6)
DaysFeed=1

; Locale (language) to use in the feed.
; https://msdn.microsoft.com/en-us/goglobal/bb896001.aspx
; Note that Weather.com uses "_" underline instead of "-" dash in the codes.
Locale=en_US

WebSite=https://wxdata.weather.com/wxdata/weather/local/#LocationCode#?cc=*&unit=#UnitOfMeasure#&dayf=#DaysFeed#&locale=#Locale#

; =======================================
; Measures
; =======================================

[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=#WebSite#
RegExp=(?siU)^(.*)$
UpdateRate=1800

[MeasureValues]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
RegExp=(?siU)<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<moon>.*<t>(.*)</t>.*</moon>

[MeasureCurrentTemp]
Measure=Plugin
Plugin=WebParser
URL=[MeasureValues]
StringIndex=3

[MeasureFeelsLikeTemp]
Measure=Plugin
Plugin=WebParser
URL=[MeasureValues]
StringIndex=4

[MeasureSunRise]
Measure=Plugin
Plugin=WebParser
URL=[MeasureValues]
StringIndex=1

[MeasureSunSet]
Measure=Plugin
Plugin=WebParser
URL=[MeasureValues]
StringIndex=2

[MeasureMoon]
Measure=Plugin
Plugin=WebParser
URL=[MeasureValues]
StringIndex=5

; =======================================
; Meters
; =======================================

[MeterBackground]
Meter=Shape
Shape=Rectangle 0,0,100,75,2,2 | Fill color 127,127,127,255 | StrokeWidth 2 | Stroke Color 200,200,200,255
X=1
Y=1

[MeterWeather]
Meter=String
MeasureName=MeasureCurrentTemp
MeasureName2=MeasureFeelsLikeTemp
MeasureName3=MeasureSunRise
MeasureName4=MeasureSunSet
MeasureName5=MeasureMoon
X=50
Y=2
FontFace=Ariel
FontSize=8
FontColor=255,255,255,255
AntiAlias=1
StringAlign=Center
StringEffect=Shadow
FontEffectColor=0,0,0,255
Text=Current Temp: %1C#CRLF#Feels Like: %2C#CRLF#Sun Rise: %3#CRLF#Sun Set: %4#CRLF#%5
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: [Solved] Weather Skin help

Post by fonpaolo »

You've done a good job! :thumbup:
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: [Solved] Weather Skin help

Post by CyberTheWorm »

fonpaolo wrote:You've done a good job! :thumbup:
:D Well it's a start at least
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: [Solved] Weather Skin help

Post by FreeRaider »

CyberTheWorm wrote::D Well it's a start at least
For shorten your code, you can remove [MeasureSite] and change [MeasureValues] in

Code: Select all

[MeasureValues]
Measure=Plugin
Plugin=WebParser
URL=#WebSite#
RegExp=(?siU)<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<moon>.*<t>(.*)</t>.*</moon>
UpdateRate=1800
because your [MeasureSite] is not used.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: [Solved] Weather Skin help

Post by fonpaolo »

Yes FreeRaider, the code I posted above is useful for more days, for only one, it's better to use your approach.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Solved] Weather Skin help

Post by balala »

I know it's a bit late, but I have to say something about CyberTheWorm's initial code: usually it's an extremely wrong idea to set the Update value of a skin which is using the WebParser plugin, to -1. That because a such plugin measure needs time to parse the data, but if the Update of the skin is set to -1, after the plugin measure gets the data, it can't be shown, because the skin is never updated, due to the negative Update value. Usually it's a much better idea to set the Update to the default 1000 (as FreeRaider suggested).
Yeah, I know you did this CyberTheWorm, this was just a short comment to make you to understand why a negative Update is undesired on a such skin.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: [Solved] Weather Skin help

Post by FreeRaider »

balala wrote:I know it's a bit late, but I have to say something about CyberTheWorm's initial code: usually it's an extremely wrong idea to set the Update value of a skin which is using the WebParser plugin, to -1. That because a such plugin measure needs time to parse the data, but if the Update of the skin is set to -1, after the plugin measure gets the data, it can't be shown, because the skin is never updated, due to the negative Update value. Usually it's a much better idea to set the Update to the default 1000 (as FreeRaider suggested).
Yeah, I know you did this CyberTheWorm, this was just a short comment to make you to understand why a negative Update is undesired on a such skin.
Just for your knowledge, in the original code of CyberTheWorm you can use Update=-1 and add a FinishAction=[!UpdateMeter *][!Redraw] option in a "parent" measure, but it will NOT update the information captured.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Solved] Weather Skin help

Post by balala »

FreeRaider wrote:Just for your knowledge, in the original code of CyberTheWorm you can use Update=-1 and add a FinishAction=[!UpdateMeter *][!Redraw] option in a "parent" measure.
Yes, that's right, it can be used, but it wasn't. Without a proper FinishAction, the skin which uses Update=-1 and the WebParser measure, won't never work.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: [Solved] Weather Skin help

Post by CyberTheWorm »

balala wrote:I know it's a bit late, but I have to say something about CyberTheWorm's initial code: usually it's an extremely wrong idea to set the Update value of a skin which is using the WebParser plugin, to -1. That because a such plugin measure needs time to parse the data, but if the Update of the skin is set to -1, after the plugin measure gets the data, it can't be shown, because the skin is never updated, due to the negative Update value. Usually it's a much better idea to set the Update to the default 1000 (as FreeRaider suggested).
Yeah, I know you did this CyberTheWorm, this was just a short comment to make you to understand why a negative Update is undesired on a such skin.
Yes I figured that out after posting and seeing the initial comments. I did not want to pull data from the web site every second. FreeRaider pointing me in the correct direction with.

Code: Select all

UpdateRate=1800
At least I have a better understanding of what to do now, thanks to all that gave the suggestions.
Post Reply