It is currently April 18th, 2024, 9:31 pm

Help with getting weather to work

Get help with creating, editing & fixing problems with skins
Doebie
Posts: 2
Joined: January 14th, 2017, 3:19 am

Help with getting weather to work

Post by Doebie »

Hi,

I've been trying to get the weather to work on a downloaded skin. I searched the forums and saw that there had been changes last year to the URLs required and changed those and it still doesn't work. I'm not sure what else it could be I'm only new at using Rainmeter. I'll include below the entire Weather.ini file. Thanks for the assistance.

Code: Select all

; Sherlock for Rainmeter v1.0
; ----------------------------------

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Author=Faiz M
AppVersion=1
Update=1000

[Metadata]
Name=SM 2
Config=
Instructions=Edit the /Weather/Weather.ini file, and replace the weather codes lines 23 and 24. Line 23 is the Yahoo weather code and 24 is the Weather.com code. Both codes can be obtained from their respective sites by searching your city and looking at the URL in the address bar Default is set to New York
Description=Sherlock Skin
Version=1
Tags=Sherlock Holmes
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
fontName=London Tube
textSize=9
YahooWeatherCode=2459115
WeatherCode=USNY0996
colorBar=235,170,0,255
colorText=255,255,255,180
colorGray=214,214,214,255





; ----------------------------------
; Styles
; ----------------------------------




[styleTitle]
StringAlign=LEFT
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[mWeatherRSS]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1600
Url=http://wxdata.weather.com/wxdata/weather/local/#WeatherCode#?cc=*&unit=#Type#&dayf=6
RegExp="(?siU).*<locale>(.*)</locale>.*<ut>(.*)</ut>.*<ud>(.*)</ud>.*<us>(.*)</us>.*<up>(.*)</up>.*<ur>(.*)</ur>.*<loc id="(.*)">.*<dnam>(.*)</dnam>.*<tm>(.*)</tm>.*<lat>(.*)</lat>.*<lon>(.*)</lon>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<zone>(.*)</zone>.*<cc>.*<lsup>(.*)</lsup>.*<obst>(.*)</obst>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<t>(.*)</t>.*<icon>(.*)</icon>.*<bar>.*<r>(.*)</r>.*<d>(.*)</d>.*<wind>.*<s>(.*)</s>.*<gust>(.*)</gust>.*<d>(.*)</d>.*<t>(.*)</t>.*<hmid>(.*)</hmid>.*<vis>(.*)</vis>.*<uv>.*<i>(.*)</i>.*<t>(.*)</t>.*<dewp>(.*)</dewp>.*<moon>.*<icon>(.*)</icon>.*<t>(.*)</t>.*"
StringIndex=1

[MeasureWeatherRSS]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=http://xml.weather.yahoo.com/forecastrss?w=#YahooWeatherCode#&u=c
RegExp=(?siU)<link.*>(.*)</link>.*city=\"(.*)\".*sunrise=\"(.*)\".*sunset=\"(.*)\".*<image>.*<url>(.*)</url>.*<title>.*:.*m .*(.*)</title>.*lat>(.*)<.*long>(.*)<.*yweather:condition.*text=\"(.*)\".*code=\"(.*)\".*temp=\"(.*)\".*yweather:forecast.*day=\"(.*)\".*high=\"(.*)\".*code=\"(.*)\".*yweather:forecast.*day=\"(.*)\".*high=\"(.*)\".*code=\"(.*)\".*
StringIndex=1

[MeasureWeatherRSSWeatherCom]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=http://wxdata.weather.com/wxdata/weather/local/#WeatherComCode#?cc=*&unit=#SCALE#&dayf=6
RegExp="(?siU)<weather ver=(.*)>(.*)<dnam>(.*)</dnam>(.*)<lat>(.*)</lat>(.*)<lon>(.*)</lon>(.*)<sunr>(.*)</sunr>(.*)<suns>(.*)</suns>(.*)<lsup>(.*)</lsup>(.*)<tmp>(.*)</tmp>(.*)<flik>(.*)</flik>(.*)<t>(.*)</t>(.*)<icon>(.*)</icon>(.*)<r>(.*)</r>(.*)<d>(.*)</d>(.*)<s>(.*)</s>(.*)<d>(.*)</d>(.*)<t>(.*)</t>(.*)<hmid>(.*)</hmid>(.*)<vis>(.*)</vis>(.*)<i>(.*)</i>(.*)<t>(.*)</t>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<day d="1" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<ppcp>(.*)</ppcp>(.*)<day d="2" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<ppcp>(.*)</ppcp>(.*)<day d="3" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<ppcp>(.*)</ppcp>(.*)<day d="4" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<ppcp>(.*)</ppcp>(.*)"
StringIndex=1
Debug=1

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#Font#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleSeperator]
SolidColor=255,255,255,15


[MeasureWeatherTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeatherRSS]
StringIndex=11

[MeasureWeatherDesc]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeatherRSS]
StringIndex=9



; ----------------------------------
; Elements
; ----------------------------------




[meterBackground]
Meter=IMAGE
ImageName=Background.png
ImageTint=200,200,200,255
ImageAlpha=0
H=210
W=380
X=0
Y=0




[Temp]
MeasureName=MeasureWeatherTemp
Meter=STRING
X=10
Y=10
FontColor=#colorText#
FontSize=20
TransformationMatrix=1;0.02;-0.27;1;0;0
StringAlign=left
FontFace=London Tube
AntiAlias=1




[Temp2]
Meter=STRING
X=28r
Y=5
FontSize=27
StringAlign=Left
FontColor=#colorText#
FontFace=London Tube
AntiAlias=1
TransformationMatrix=1;0.02;-0.27;1;0;0
Postfix="°"

[Temp3]
Meter=STRING
X=25r
Y=7
FontSize=21
StringAlign=Left
FontColor=#colorText#
FontFace=London Tube
AntiAlias=1
TransformationMatrix=1;0.02;-0.27;1;0;0
Postfix="|"




[Desc]
MeasureName=MeasureWeatherDesc
Meter=STRING
X=80
Y=10
FontColor=#colorText#
FontSize=20
StringAlign=Left
FontFace=#Font#
AntiAlias=1
TransformationMatrix=1;0.02;-0.27;1;0;0


User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with getting weather to work

Post by eclectic-tech »

Hmm... You do not have a variable set for the 'Type' of unit in your URL. I added a 'Type' variable, and set it to M for Celsius (use F for Fahrenheit).

You have 3 weather measures (2 for Weather.com and 1 for Yahoo)...
The one for Yahoo is not reliable, not working, and not needed.
Sadly, this is the one that is referred to in your Temp and Condition measures.

The second one for Weather.com is also not needed.

Finally, the StringIndex numbers for the Temp and Condition needed to be changed to match the [mWeatherRSS] references.

Code: Select all

; Sherlock for Rainmeter v1.0
; ----------------------------------

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Author=Faiz M
AppVersion=1
Update=1000

[Metadata]
Name=SM 2
Config=
Instructions=Edit the /Weather/Weather.ini file, and replace the weather codes lines 23 and 24. Line 23 is the Yahoo weather code and 24 is the Weather.com code. Both codes can be obtained from their respective sites by searching your city and looking at the URL in the address bar Default is set to New York
Description=Sherlock Skin
Version=1
Tags=Sherlock Holmes
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
fontName=London Tube
textSize=9
YahooWeatherCode=2459115
WeatherCode=USNY0996
colorBar=235,170,0,255
colorText=255,255,255,180
colorGray=214,214,214,255
; Set to m for Celsius / f for fahrenheit
Type=m





; ----------------------------------
; Styles
; ----------------------------------




[styleTitle]
StringAlign=LEFT
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[mWeatherRSS]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1600
Url=https://wxdata.weather.com/wxdata/weather/local/#WeatherCode#?cc=*&unit=#Type#&dayf=6
RegExp="(?siU).*<locale>(.*)</locale>.*<ut>(.*)</ut>.*<ud>(.*)</ud>.*<us>(.*)</us>.*<up>(.*)</up>.*<ur>(.*)</ur>.*<loc id="(.*)">.*<dnam>(.*)</dnam>.*<tm>(.*)</tm>.*<lat>(.*)</lat>.*<lon>(.*)</lon>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<zone>(.*)</zone>.*<cc>.*<lsup>(.*)</lsup>.*<obst>(.*)</obst>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<t>(.*)</t>.*<icon>(.*)</icon>.*<bar>.*<r>(.*)</r>.*<d>(.*)</d>.*<wind>.*<s>(.*)</s>.*<gust>(.*)</gust>.*<d>(.*)</d>.*<t>(.*)</t>.*<hmid>(.*)</hmid>.*<vis>(.*)</vis>.*<uv>.*<i>(.*)</i>.*<t>(.*)</t>.*<dewp>(.*)</dewp>.*<moon>.*<icon>(.*)</icon>.*<t>(.*)</t>.*"
StringIndex=1

; [MeasureWeatherRSS]
; Measure=Plugin
; Plugin=Plugins\WebParser.dll
; UpdateRate=1800
; Url=http://xml.weather.yahoo.com/forecastrss?w=#YahooWeatherCode#&u=c
; RegExp=(?siU)<link.*>(.*)</link>.*city=\"(.*)\".*sunrise=\"(.*)\".*sunset=\"(.*)\".*<image>.*<url>(.*)</url>.*<title>.*:.*m .*(.*)</title>.*lat>(.*)<.*long>(.*)<.*yweather:condition.*text=\"(.*)\".*code=\"(.*)\".*temp=\"(.*)\".*yweather:forecast.*day=\"(.*)\".*high=\"(.*)\".*code=\"(.*)\".*yweather:forecast.*day=\"(.*)\".*high=\"(.*)\".*code=\"(.*)\".*
; StringIndex=1

; [MeasureWeatherRSSWeatherCom]
; Measure=Plugin
; Plugin=Plugins\WebParser.dll
; UpdateRate=3600
; Url=https://wxdata.weather.com/wxdata/weather/local/#WeatherComCode#?cc=*&unit=#SCALE#&dayf=6
; RegExp="(?siU)<weather ver=(.*)>(.*)<dnam>(.*)</dnam>(.*)<lat>(.*)</lat>(.*)<lon>(.*)</lon>(.*)<sunr>(.*)</sunr>(.*)<suns>(.*)</suns>(.*)<lsup>(.*)</lsup>(.*)<tmp>(.*)</tmp>(.*)<flik>(.*)</flik>(.*)<t>(.*)</t>(.*)<icon>(.*)</icon>(.*)<r>(.*)</r>(.*)<d>(.*)</d>(.*)<s>(.*)</s>(.*)<d>(.*)</d>(.*)<t>(.*)</t>(.*)<hmid>(.*)</hmid>(.*)<vis>(.*)</vis>(.*)<i>(.*)</i>(.*)<t>(.*)</t>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<day d="1" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<ppcp>(.*)</ppcp>(.*)<day d="2" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<ppcp>(.*)</ppcp>(.*)<day d="3" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<ppcp>(.*)</ppcp>(.*)<day d="4" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<ppcp>(.*)</ppcp>(.*)"
; StringIndex=1
; Debug=1

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#Font#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleSeperator]
SolidColor=255,255,255,15


[MeasureWeatherTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mWeatherRSS]
StringIndex=17

[MeasureWeatherDesc]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[mWeatherRSS]
StringIndex=19



; ----------------------------------
; Elements
; ----------------------------------




[meterBackground]
Meter=IMAGE
ImageName=Background.png
ImageTint=200,200,200,255
ImageAlpha=0
H=210
W=380
X=0
Y=0




[Temp]
MeasureName=MeasureWeatherTemp
Meter=STRING
X=10
Y=10
FontColor=#colorText#
FontSize=20
TransformationMatrix=1;0.02;-0.27;1;0;0
StringAlign=left
FontFace=London Tube
AntiAlias=1




[Temp2]
Meter=STRING
X=28r
Y=5
FontSize=27
StringAlign=Left
FontColor=#colorText#
FontFace=London Tube
AntiAlias=1
TransformationMatrix=1;0.02;-0.27;1;0;0
Postfix="°"

[Temp3]
Meter=STRING
X=25r
Y=7
FontSize=21
StringAlign=Left
FontColor=#colorText#
FontFace=London Tube
AntiAlias=1
TransformationMatrix=1;0.02;-0.27;1;0;0
Postfix="|"




[Desc]
MeasureName=MeasureWeatherDesc
Meter=STRING
X=80
Y=10
FontColor=#colorText#
FontSize=20
StringAlign=Left
FontFace=#Font#
AntiAlias=1
TransformationMatrix=1;0.02;-0.27;1;0;0

Doebie
Posts: 2
Joined: January 14th, 2017, 3:19 am

Re: Help with getting weather to work

Post by Doebie »

Thank you so much! It worked :)

Very much appreciated!
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with getting weather to work

Post by balala »

eclectic-tech wrote:Hmm... You do not have a variable set for the 'Type' of unit in your URL. I added a 'Type' variable, and set it to M for Celsius (use F for Fahrenheit).
Sorry eclectic-tech, I have to disagree. To be precise, the Type variable should be either m (or M) for temperatures in Celsius, either i (or I), for temperatures in Fahrenheit (m as metric, i as imperial). The simple fact that the measure works for Type=f is that for any other letter than m, the temperatures are returned into the default unit, which is the Fahrenheit.
I hope you don't mind...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with getting weather to work

Post by eclectic-tech »

balala wrote:Sorry eclectic-tech, I have to disagree. To be precise, the Type variable should be either m (or M) for temperatures in Celsius, either i (or I), for temperatures in Fahrenheit (m as metric, i as imperial). The simple fact that the measure works for Type=f is that for any other letter than m, the temperatures are returned into the default unit, which is the Fahrenheit.
I hope you don't mind...
No problem... I haven't written a new weather skin for a while and thought I had it right...thanks for the clarity! :D
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with getting weather to work

Post by balala »

eclectic-tech wrote:No problem... I haven't written a new weather skin for a while and thought I had it right...thanks for the clarity! :D
You're welcome. Definitely the f value used for the variable, will work, but not because this is the right value, but because, as I described, in such cases the default i value is used.