It is currently September 18th, 2019, 12:06 am

Weather Problem (Help)

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 8620
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather Problem (Help)

balala » September 2nd, 2019, 8:32 pm

marci1229 wrote:
September 2nd, 2019, 7:59 pm
Yeah I saw these weather icons before. But honestly these icons not compatible with my skins. I mean my skin with these icons looks terrible.
I'd try to rewrite the code of the skin itself, using your icons. In a such case the whole skin would look like the original skin you've posted, but would work using xenium's code.
If you don't know how to do this, tomorrow I'll help you. Right now here is almost midnight, so I'm gonna go to sleep, but if no one gonna help you, tomorrow I will.
User avatar
marci1229
Posts: 8
Joined: September 2nd, 2019, 5:40 pm
Location: Hungary

Re: Weather Problem (Help)

marci1229 » September 3rd, 2019, 5:15 am

balala wrote:
September 2nd, 2019, 8:32 pm
I'd try to rewrite the code of the skin itself, using your icons. In a such case the whole skin would look like the original skin you've posted, but would work using xenium's code.
If you don't know how to do this, tomorrow I'll help you. Right now here is almost midnight, so I'm gonna go to sleep, but if no one gonna help you, tomorrow I will.
Nice! Thanks a lot! Im here.
xenium
Posts: 362
Joined: January 4th, 2018, 9:52 pm

Re: Weather Problem (Help)

xenium » September 3rd, 2019, 9:37 am

marci1229 wrote:
September 3rd, 2019, 5:15 am
This is the new code for your weather skin.
The weather condition will be displayed in Hungarian (original translation from The Weather Channel website)

Right-click on the weather skin and choose edit skin.
Replace all existing code with the code below.
Then save, close the file and refresh your skin.

Code: Select all

[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh] 

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
Scale=0.33
URL=https://weather.com/hu-HU/idojaras/ma/l/#Location#


;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureCheckNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
SysInfoData=Best
OnChangeAction=[!CommandMeasure MeasureCurrent "Update"]

;-------------------------------------------------------------
;-------------------------------------------------------------



[MeasureCurrent]
Measure=WebParser
Url=#URL#
RegExp=(?siU)(?(?=.*</div></span><p class="today_nowcard-).*timestamp"><span>(.*)<!----> </span><span>(.*)</span>).*(?(?=.*<div class="today_nowcard-section today_nowcard-condition"><div class="condition-icon wx-weather-icon vector).*"><icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon icon-svg icon-svg-.* .* icon-.*">.*</icon></div>)(?(?=.*<div class="today_nowcard-temp").*><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-phrase).*">(.*)</div>)
UpdateRate=600
LogSubstringErrors=0


[MeasureWeatherIcons]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=3

[MeasureWeatherTemp]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=4

[MeasureTempUnit]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=5


[MeasureWeatherCond]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=6
DecodeCharacterReference=1


;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentIcon]
Meter=Image
MeasureName=MeasureWeatherIcons
Path=#@#WeatherIcons
X=(455*#Scale#)
Y=(0*#Scale#)
W=(300*#Scale#)
AntiAlias=1
ImageTint=#FontColor2#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentCond]
Meter=String
MeasureName=MeasureWeatherCond
MeasureName2=MeasureWeatherTemp
MeasureName3=MeasureTempUnit
StringAlign=Center
StringCase=Upper
FontColor=#FontColor#
FontFace=Product Sans
FontSize=(45*#Scale#)
X=(620*#Scale#)
Y=(300*#Scale#)
W=(940*#Scale#)
H=(150*#Scale#)
Text="%1 %2%3C"
ClipString=1
AntiAlias=1
User avatar
marci1229
Posts: 8
Joined: September 2nd, 2019, 5:40 pm
Location: Hungary

Re: Weather Problem (Help)

marci1229 » September 3rd, 2019, 9:47 am

xenium wrote:
September 3rd, 2019, 9:37 am
This is the new code for your weather skin.
The weather condition will be displayed in Hungarian (original translation from The Weather Channel website)

Right-click on the weather skin and choose edit skin.
Replace all existing code with the code below.
Then save, close the file and refresh your skin.

Code: Select all

[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh] 

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
Scale=0.33
URL=https://weather.com/hu-HU/idojaras/ma/l/#Location#


;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureCheckNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
SysInfoData=Best
OnChangeAction=[!CommandMeasure MeasureCurrent "Update"]

;-------------------------------------------------------------
;-------------------------------------------------------------



[MeasureCurrent]
Measure=WebParser
Url=#URL#
RegExp=(?siU)(?(?=.*</div></span><p class="today_nowcard-).*timestamp"><span>(.*)<!----> </span><span>(.*)</span>).*(?(?=.*<div class="today_nowcard-section today_nowcard-condition"><div class="condition-icon wx-weather-icon vector).*"><icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon icon-svg icon-svg-.* .* icon-.*">.*</icon></div>)(?(?=.*<div class="today_nowcard-temp").*><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-phrase).*">(.*)</div>)
UpdateRate=600
LogSubstringErrors=0


[MeasureWeatherIcons]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=3

[MeasureWeatherTemp]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=4

[MeasureTempUnit]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=5


[MeasureWeatherCond]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=6
DecodeCharacterReference=1


;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentIcon]
Meter=Image
MeasureName=MeasureWeatherIcons
Path=#@#WeatherIcons
X=(455*#Scale#)
Y=(0*#Scale#)
W=(300*#Scale#)
AntiAlias=1
ImageTint=#FontColor2#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentCond]
Meter=String
MeasureName=MeasureWeatherCond
MeasureName2=MeasureWeatherTemp
MeasureName3=MeasureTempUnit
StringAlign=Center
StringCase=Upper
FontColor=#FontColor#
FontFace=Product Sans
FontSize=(45*#Scale#)
X=(620*#Scale#)
Y=(300*#Scale#)
W=(940*#Scale#)
H=(150*#Scale#)
Text="%1 %2%3C"
ClipString=1
AntiAlias=1
OMG! Thank you for the help! Yes it is actually show the conditions. Thank you very much!
xenium
Posts: 362
Joined: January 4th, 2018, 9:52 pm

Re: Weather Problem (Help)

xenium » September 3rd, 2019, 10:25 am

marci1229 wrote:
September 3rd, 2019, 9:47 am
OMG! Thank you for the help! Yes it is actually show the conditions. Thank you very much!
You're very welcome.
User avatar
marci1229
Posts: 8
Joined: September 2nd, 2019, 5:40 pm
Location: Hungary

Re: Weather Problem (Help)

marci1229 » September 3rd, 2019, 12:00 pm

xenium wrote:
September 3rd, 2019, 10:25 am
You're very welcome.
Can you make a code please for HUXX0004 ? Its a different location but also in Hungary. This is my second home.
xenium
Posts: 362
Joined: January 4th, 2018, 9:52 pm

Re: Weather Problem (Help)

xenium » September 3rd, 2019, 12:46 pm

marci1229 wrote:
September 3rd, 2019, 12:00 pm
Can you make a code please for HUXX0004 ? Its a different location but also in Hungary. This is my second home.
First add in the Variables.inc file from the @Resources folder: Location2 = HUXX0004
Then replace the previous code with the code below:

Code: Select all

[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh] 

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
Scale=0.29
URL=https://weather.com/hu-HU/idojaras/ma/l/#Location#
URL2=https://weather.com/hu-HU/idojaras/ma/l/#Location2#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureCheckNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
SysInfoData=Best
OnChangeAction=[!CommandMeasure MeasureCity1 "Update"][!CommandMeasure MeasureCurrent1 "Update"][!CommandMeasure MeasureCity2 "Update"][!CommandMeasure MeasureCurrent2 "Update"]

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureCity1]
Measure=WebParser
Url=#URL#
RegExp=(?siU)(?(?=.*<h1 class="h4 today_nowcard-location").* className="h4 today_nowcard-location">(.*)<span class=".*" className=".*"></span></h1>)
UpdateRate=600
LogSubstringErrors=0
StringIndex=1
DecodeCharacterReference=1


[MeasureCurrent1]
Measure=WebParser
Url=#URL#
RegExp=(?siU)(?(?=.*</div></span><p class="today_nowcard-).*timestamp"><span>(.*)<!----> </span><span>(.*)</span>).*(?(?=.*<div class="today_nowcard-section today_nowcard-condition"><div class="condition-icon wx-weather-icon vector).*"><icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon icon-svg icon-svg-.* .* icon-.*">.*</icon></div>)(?(?=.*<div class="today_nowcard-temp").*><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-phrase).*">(.*)</div>)
UpdateRate=600
LogSubstringErrors=0


[MeasureWeatherIcons1]
Measure=WebParser
Url=[MeasureCurrent1]
StringIndex=3

[MeasureWeatherTemp1]
Measure=WebParser
Url=[MeasureCurrent1]
StringIndex=4

[MeasureTempUnit1]
Measure=WebParser
Url=[MeasureCurrent1]
StringIndex=5


[MeasureWeatherCond1]
Measure=WebParser
Url=[MeasureCurrent1]
StringIndex=6
DecodeCharacterReference=1


;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentIcon1]
Meter=Image
MeasureName=MeasureWeatherIcons1
Path=#@#WeatherIcons
X=(455*#Scale#)
Y=(0*#Scale#)
W=(300*#Scale#)
AntiAlias=1
ImageTint=#FontColor2#
ToolTipText=[MeasureCity1]
DynamicVariables=1
;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentCond1]
Meter=String
MeasureName=MeasureWeatherCond1
MeasureName2=MeasureWeatherTemp1
MeasureName3=MeasureTempUnit1
StringAlign=Center
StringCase=Upper
FontColor=#FontColor#
FontFace=Product Sans
FontSize=(45*#Scale#)
X=(620*#Scale#)
Y=(300*#Scale#)
W=(940*#Scale#)
H=(150*#Scale#)
Text="%1 %2%3C"
ClipString=1
AntiAlias=1

;====================================================================


[MeasureCity2]
Measure=WebParser
Url=#URL2#
RegExp=(?siU)(?(?=.*<h1 class="h4 today_nowcard-location").* className="h4 today_nowcard-location">(.*)<span class=".*" className=".*"></span></h1>)
UpdateRate=600
LogSubstringErrors=0
StringIndex=1
DecodeCharacterReference=1


[MeasureCurrent2]
Measure=WebParser
Url=#URL2#
RegExp=(?siU)(?(?=.*</div></span><p class="today_nowcard-).*timestamp"><span>(.*)<!----> </span><span>(.*)</span>).*(?(?=.*<div class="today_nowcard-section today_nowcard-condition"><div class="condition-icon wx-weather-icon vector).*"><icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon icon-svg icon-svg-.* .* icon-.*">.*</icon></div>)(?(?=.*<div class="today_nowcard-temp").*><span class="">(.*)<sup>(.*)</sup></span>).*(?(?=.*<div class="today_nowcard-phrase).*">(.*)</div>)
UpdateRate=600
LogSubstringErrors=0


[MeasureWeatherIcons2]
Measure=WebParser
Url=[MeasureCurrent2]
StringIndex=3

[MeasureWeatherTemp2]
Measure=WebParser
Url=[MeasureCurrent2]
StringIndex=4

[MeasureTempUnit2]
Measure=WebParser
Url=[MeasureCurrent2]
StringIndex=5


[MeasureWeatherCond2]
Measure=WebParser
Url=[MeasureCurrent2]
StringIndex=6
DecodeCharacterReference=1


;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentIcon2]
Meter=Image
MeasureName=MeasureWeatherIcons2
Path=#@#WeatherIcons
X=(1455*#Scale#)
Y=(0*#Scale#)
W=(300*#Scale#)
AntiAlias=1
ImageTint=#FontColor2#
ToolTipText=[MeasureCity2]
DynamicVariables=1
;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentCond2]
Meter=String
MeasureName=MeasureWeatherCond2
MeasureName2=MeasureWeatherTemp2
MeasureName3=MeasureTempUnit2
StringAlign=Center
StringCase=Upper
FontColor=#FontColor#
FontFace=Product Sans
FontSize=(45*#Scale#)
X=(1620*#Scale#)
Y=(300*#Scale#)
W=(940*#Scale#)
H=(150*#Scale#)
Text="%1 %2%3C"
ClipString=1
AntiAlias=1
Place your cursor over each weather icon for the city name.
User avatar
balala
Rainmeter Sage
Posts: 8620
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather Problem (Help)

balala » September 3rd, 2019, 2:55 pm

xenium wrote:
September 3rd, 2019, 12:46 pm
First add in the Variables.inc file from the @Resources folder: Location2 = HUXX0004
Then replace the previous code with the code below:
Not very sure you have to rewrite the code. Two instances of the already existing skin can be loaded (changing the Location variable in one of them) for the two locations. Much simpler.
Also note that the Author option doesn't belong to the [Rainmeter] section any more, but to [Metadata]. This definitely has not too much importance, but just to be precise, this has to be said.
xenium
Posts: 362
Joined: January 4th, 2018, 9:52 pm

Re: Weather Problem (Help)

xenium » September 3rd, 2019, 3:23 pm

balala wrote:
September 3rd, 2019, 2:55 pm
Not very sure you have to rewrite the code. Two instances of the already existing skin can be loaded (changing the Location variable in one of them) for the two locations. Much simpler.
I rewrote the code so that both locations are displayed at the same time (not to change locations between them).
User avatar
balala
Rainmeter Sage
Posts: 8620
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather Problem (Help)

balala » September 3rd, 2019, 5:16 pm

xenium wrote:
September 3rd, 2019, 3:23 pm
I rewrote the code so that both locations are displayed at the same time (not to change locations between them).
Yes, but I said that even if you don't rewrite it, you can copy the Robik\Weather config with another name (for instance Robik\Weather2) add another location variable into the Variables.inc file (Location2 for example), then use this one into any of the skins. Then you can load both skins at the same time. This way you avoid to rewrite the code.
Obviously your solution is alright as well.