It is currently March 28th, 2024, 4:43 pm

Degree symbol getting translated

Get help with creating, editing & fixing problems with skins
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Degree symbol getting translated

Post by Codger »

I'm using RegExp to pull in weather data. One of the fields is something like "70°F" and what I am getting displayed is "70°F"

I've tried all types of substitutions all to no avail.

(Weather starts on line 127

Code: Select all


[Rainmeter]
Update=1000
DynamicWindowSize=1
MiddleMouseDownAction=!RainmeterDeactivateConfig

[Metadata]
Name=Hideaway Blob Clock
Author=Codger
Config=
Instructions=
Version=1.1.0
License=License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0
Variant=
Preview=

[Variables]
White=255,255,255,255
Font="Diner"
;Weather variables
Zip=02346
FontColor=255,255,80,255
FontInactive=190, 120, 20, 255
UpdateFreq=1800

[BackgroundTime]
Meter=Shape
Shape=Rectangle 0,13,280,50 | Fill Color 20,20,20,1  | StrokeWidth 0
LeftMouseDoubleClickAction=[!ToggleMeter MeterTime]

[BackgroundDate]
Meter=Shape
Shape=Rectangle 0,63,280,40 | Fill Color 20,20,20,1 | StrokeWidth 0
LeftMouseDoubleClickAction=[!ToggleMeter MeterDate][!ToggleMeter MeterMonth][!ToggleMeter MeterDay]

[BackgroundWeather]
Meter=Shape
Shape=Rectangle 0,103,280,40 | Fill Color 20,20,20,1 | StrokeWidth 0
LeftMouseDoubleClickAction=[!ToggleMeter MeterTemp][!ToggleMeter MeterDesc][!ToggleMeter MeterRealFeel]


:==============================
:      Format Time/Date

[MeasureTime]
Measure=Time
Format=%#I:%M %p

[MeasureDate]
Measure=Time
Format=%d

[MeasureMonth]
Measure=Time
Format=%B

[MeasureDay]
Measure=Time
Format=%A

:--- Time

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=2
Y=2
FontColor=#White#
FontSize=40
FontFace=#Font#
StringStyle=Bold
StringAlign=LEFT
StringEffect="Shadow"
FontEffectColor=0,0,0,255
InlineSetting=Size | 12
InlinePattern=( )
AntiAlias=1

;--- Date

[MeterDate]
MeasureName=MeasureDate
Meter=STRING
X=1r
Y=-25R
FontColor=#White#
FontSize=36
FontFace=#Font#
StringStyle=Bold
StringAlign=LEFT
StringEffect="Shadow"
FontEffectColor=0,0,0,255
AntiAlias=1

[MeterMonth]
MeasureName=MeasureMonth
Meter=STRING
X=73r
Y=8r
FontColor=255,80,120,200
FontSize=18
FontFace=#Font#
StringStyle=Bold
StringAlign=LEFT
StringEffect="Shadow"
FontEffectColor=0,0,0,255
InlineSetting=Case | Upper
AntiAlias=1

;monday, etc
[MeterDay]
MeasureName=MeasureDay
Meter=STRING
X=r
Y=-11R
FontColor=#White#
FontSize=15
FontFace=#Font#
StringStyle=Bold
StringAlign=LEFT
StringEffect="Shadow"
FontEffectColor=0,0,0,255
InlineSetting=Case | Upper
AntiAlias=1

;--- Weather

[GetWeather]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=#UpdateFreq#
Url=http://www.freeweather.com/cgi-bin/weather/weather.cgi?pands=02346&daysonly=0&maxdays=1
RegExp=(?siU)>Currently:</td>.*>(.*)</td>.*>Temp:</td>.*>(.*)</td>.*>Humidity:</td>.*>(.*)</td>.*</table>

;

[MeasureWeatherDesc]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[GetWeather]
StringIndex=1

[MeasureWeatherTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[GetWeather]
StringIndex=2

[MeasureWeatherHumidity]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[GetWeather]
StringIndex=3

;

[MeterTemp]
MeasureName=MeasureWeatherTemp
Meter=STRING
X=-9
Y=15r
FontFace=#Font#
FontColor=#FontColor#
FontSize=36
;StringStyle=Bold
;StringAlign=LEFT
StringEffect="Shadow"
;InlineSetting=Case | Lower
;Antialias=1
UpdateDivider=10

[MeterDesc]
MeasureName=MeasureWeatherDesc
Meter=STRING
X=88
Y=6r
FontColor=#FontColor#
FontSize=15
FontFace=#Font#
StringStyle=Bold
StringAlign=LEFT
StringEffect="Shadow"
FontEffectColor=0,0,0,255
InlineSetting=Case | Upper
Antialias=1

[MeterWeatherHumidity]
MeasureName=MeasureWeatherHumidity
Meter=STRING
X=6r
Y=20r
FontColor=#FontColor#
FontSize=10
FontFace=#Font#
StringStyle=Bold
StringEffect="Shadow"
FontEffectColor=0,0,0,255
StringAlign=Left
Antialias=1
Text=Humidity: %1
DynamicVariables=1
UpdateDivider=10

User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Degree symbol getting translated

Post by balala »

I can't open the posted URL, not even in my web browser, getting the following error message:

Code: Select all

Access Denied
You don't have permission to access "http://www.freeweather.com/cgi-bin/weather/weather.cgi?" on this server.
Reference #18.97081602.1498411416.eb66e7 
However probably what you've described should be avoided adding a DecodeCharacterReference=1 option, to the [MeasureWeatherTemp] measure. Details: https://docs.rainmeter.net/manual/plugins/webparser/#DecodeCharacterReference
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Degree symbol getting translated

Post by Codger »

balala wrote:I can't open the posted URL, not even in my web browser, getting the following error message:

Code: Select all

Access Denied
You don't have permission to access "http://www.freeweather.com/cgi-bin/weather/weather.cgi?" on this server.
Reference #18.97081602.1498411416.eb66e7 
However probably what you've described should be avoided adding a DecodeCharacterReference=1 option, to the [MeasureWeatherTemp] measure. Details: https://docs.rainmeter.net/manual/plugins/webparser/#DecodeCharacterReference
Odd that a public page wouldn't let you in. I just tried hopping to three other countries with no problem.
Regardless, you fixed the problem. Thank you very much.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Degree symbol getting translated

Post by balala »

Glad to help.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Degree symbol getting translated

Post by balala »

Let me two more observations about your code:
  • The !Rainmeter... bang prefix, used in the MiddleMouseDownAction option of the [Rainmeter] section is not needed, ebing deprecated. Remove it, using MiddleMouseDownAction=!DeactivateConfig, instead of the original MiddleMouseDownAction=![color=#FF0000]Rainmeter[/color]DeactivateConfig. Details: https://docs.rainmeter.net/manual/bangs/#Rainmeter
  • The more concise form of the Plugin option, used in all four WebParser plugin measures ([GetWeather], [MeasureWeatherDesc], [MeasureWeatherTemp] and [MeasureWeatherHumidity]) would be Plugin=WebParser. Anything else isn't needed: Plugin=[color=#FF0000]Plugins\[/color]WebParser[color=#FF0000].dll[/color]. Definitely the used form isn't wrong and perfectly works, however is not needed.
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Degree symbol getting translated

Post by Codger »

balala wrote:Let me two more observations about your code:
  • The !Rainmeter... bang prefix, used in the MiddleMouseDownAction option of the [Rainmeter] section is not needed, ebing deprecated. Remove it, using MiddleMouseDownAction=!DeactivateConfig, instead of the original MiddleMouseDownAction=![color=#FF0000]Rainmeter[/color]DeactivateConfig. Details: https://docs.rainmeter.net/manual/bangs/#Rainmeter
  • The more concise form of the Plugin option, used in all four WebParser plugin measures ([GetWeather], [MeasureWeatherDesc], [MeasureWeatherTemp] and [MeasureWeatherHumidity]) would be Plugin=WebParser. Anything else isn't needed: Plugin=[color=#FF0000]Plugins\[/color]WebParser[color=#FF0000].dll[/color]. Definitely the used form isn't wrong and perfectly works, however is not needed.
The MouseDown came from the template it starts you off with. I never even noticed it. Now I see what it does. I'll make the change as that is depreciated.

The other had come from scavenged code when I was first trying to see how weather widgets worked. I had figured any path reference was probably an incorrect way. But it was working and I had so much else to straighten out.

Thanks for the polishes. Down to one stubborn cosmetic problem and I'll be ready to release my first widget. Only for the US and just a widget not a skin, but is something and I think all mine. :bow:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Degree symbol getting translated

Post by balala »

Codger wrote:The other had come from scavenged code when I was first trying to see how weather widgets worked. I had figured any path reference was probably an incorrect way. But it was working and I had so much else to straighten out.
No, it's not "incorrect". As I said, it's perfectly working. Just is an old form of the option.
Codger wrote:Only for the US and just a widget not a skin, but is something and I think all mine. :bow:
I think in Rainmeter, the "widget" term is not used. We're working with skins instead. I know many people got used to use it, but it's not a widget...
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Degree symbol getting translated

Post by Codger »

balala wrote:No, it's not "incorrect". As I said, it's perfectly working. Just is an old form of the option.

I think in Rainmeter, the "widget" term is not used. We're working with skins instead. I know many people got used to use it, but it's not a widget...
I'm stubborn :D
To me a widget is a 'thing' that does something.
And a skin is a collection of widgets with a cohesive and esthetic style.
Right or wrong, I'm sticking with it. :p
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Degree symbol getting translated

Post by balala »

Codger wrote:To me a widget is 'thing' that does something.
And a skin is a collection of widgets with a cohesive and esthetic style.
As I said, many people got used to use the terms this way. But in Rainmeter the "widgets" are skins and a collection of them is a "suite" of skins (read the last paragraph of this).
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Degree symbol getting translated

Post by Codger »

I could not leave well enough alone.
Still have a placement problem if sections are clicked off but I'll crack that eventually.

But I'm back up against a scope problem again. I want a variable that I can start with a value, change that value at will and use everywhere. And I can't remember how to do it.

I remembered that for some reason that utterly baffles me the Variables section only creates static variables.
And creating a variable in a measure seems to have the desired effect but I can't seem to cumulously change it.
The variable is Scale. It should get bigger or smaller with the mouse wheel but it only does so once.

Code: Select all

; double click on time, date or weather to turn off
; double click again WHERE THEY WERE to turn back on
; add your zip code on line 24

; I think weather is only US and definitely would need a touch of recoding for Celcius. If you want to disable the weather change WeatherHidden to 1.  

[Rainmeter]
Update=1000
DynamicWindowSize=1
MiddleMouseDownAction=!DeactivateConfig

[Metadata]
Name=Hideaway Blob Clock
Author=Codger
Config=
Instructions=
Version=1.2.0
License=License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0
Variant=
Preview=

[Variables]
;Change next line to your zip code
Zip=90210
;How often to update weather (15 minutes)
UpdateWeatherSeconds=900
;The higher InitScale the smaller the widget
;Sorry, by the time I realized Calc was worthless for my needs I was stuck backwards
InitScale=1.2
;Change to 1 for Clock to stay hidden in refresh. Same for Date and Weather.
TimeHidden = 0
DateHidden = 0
WeatherHidden = 0

White=255,255,255,255
Yellow=255,255,80,255
Black=0,0,0,255

[DisplayStyle1]
Meter=String
FontColor=#Yellow#
FontFace=Diner
StringStyle=Bold
StringEffect="Shadow"
FontEffectColor=#Black#

[Initialize]
Measure=Calc
OnUpdateAction=[!SetVariable Scale #InitScale#]
DynamicVariables=1
UpdateDivider=-1

[BackgroundTime]
Meter=Shape
Shape=Rectangle 0,(17/#Scale#),(280/#Scale#),(45/#Scale#) | Fill Color 220,20,20,1  | StrokeWidth 0
LeftMouseDoubleClickAction=[!ToggleMeter MeterTime][!ToggleMeter MeterTimeMarker]
MouseScrollDownAction=[!SetVariable Scale (#Scale#-0.25)]
MouseScrollUpAction=[!SetVariable Scale (#Scale#+0.25)]
DynamicVariables=1
UpdateDivider=-1

[BackgroundDate]
Meter=Shape
Shape=Rectangle 0,(63/#Scale#),(280/#Scale#),(40/#Scale#) | Fill Color 20,220,20,1 | StrokeWidth 0
LeftMouseDoubleClickAction=[!ToggleMeter MeterDate][!ToggleMeter MeterMonth][!ToggleMeter MeterDay][!ToggleMeter MeterDateMarker]
MouseScrollDownAction=[!SetVariable Scale (#Scale#-0.025)]
MouseScrollUpAction=[!SetVariable Scale (#Scale#+0.025)]
DynamicVariables=1
UpdateDivider=-1

[BackgroundWeather]
Meter=Shape
Shape=Rectangle 0,(104/#Scale#),(280/#Scale#),(40/#Scale#) | Fill Color 20,20,220,1 | StrokeWidth 0
LeftMouseDoubleClickAction=[!ToggleMeter MeterTemp][!ToggleMeter MeterDesc][!ToggleMeter MeterWeatherHumidity]
MouseScrollDownAction=[!SetVariable Scale (#Scale#-0.025)]
MouseScrollUpAction=[!SetVariable Scale (#Scale#+0.025)]
DynamicVariables=1
UpdateDivider=-1

:==============================
:      Format Time/Date

[MeasureTime]
Measure=Time
Format=%#I:%M %p

[MeasureDate]
Measure=Time
Format=%d

[MeasureMonth]
Measure=Time
Format=%B

[MeasureDay]
Measure=Time
Format=%A

;--- Time

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=2
Y=(2/#Scale#)r
MeterStyle=DisplayStyle1
FontColor=#White#
FontSize=(40/#Scale#)
InlineSetting=Size | (12/#Scale#)
InlinePattern=( )
AntiAlias=1
DynamicVariables=1
Hidden = #TimeHidden#

[MeterTimeMarker]
Meter=String
X=2
Y=(46/#Scale#)r
DynamicVariables=1
Hidden = #TimeHidden#

;--- Date

[MeterDate]
MeasureName=MeasureDate
Meter=STRING
X=2
Y=(2/#Scale#)r
MeterStyle=DisplayStyle1
FontColor=#White#
FontSize=(36/#Scale#)
AntiAlias=1
DynamicVariables=1
Hidden = #DateHidden#

[MeterMonth]
MeasureName=MeasureMonth
Meter=STRING
X=(73/#Scale#)r
Y=(8/#Scale#)r
MeterStyle=DisplayStyle1
FontColor=255,80,120,200
FontSize=(18/#Scale#)
InlineSetting=Case | Upper
AntiAlias=1
DynamicVariables=1
Hidden = #DateHidden#

;monday, etc
[MeterDay]
MeasureName=MeasureDay
Meter=STRING
X=r
Y=(-11/#Scale#)R
MeterStyle=DisplayStyle1
FontColor=#White#
FontSize=(15/#Scale#)
InlineSetting=Case | Upper
AntiAlias=1
DynamicVariables=1
Hidden = #DateHidden#

[MeterDateMarker]
Meter=String
X=2
Y=(16/#Scale#)r
DynamicVariables=1
Hidden = #DateHidden#

;--- Weather

[GetWeather]
Measure=Plugin
Plugin=WebParser
UpdateRate=#UpdateWeatherSeconds#
Url=http://www.freeweather.com/cgi-bin/weather/weather.cgi?pands=02346&daysonly=0&maxdays=1
RegExp=(?siU)>Currently:</td>.*> (.*)</td>.*>Temp:</td>.*> (.*)</td>.*>Humidity:</td>.*> (.*)</td>.*</table>
FinishAction=[!UpdateMeter "MeterTemp"][!UpdateMeter "MeterDesc"][!UpdateMeter "MeterWeatherHumidity"]

;

[MeasureWeatherDesc]
Measure=Plugin
Plugin=WebParser
Url=[GetWeather]
StringIndex=1
UpdateDivider=-1

[MeasureWeatherTemp]
Measure=Plugin
Plugin=WebParser
Url=[GetWeather]
StringIndex=2
DecodeCharacterReference=1
UpdateDivider=-1

[MeasureWeatherHumidity]
Measure=Plugin
Plugin=WebParser
Url=[GetWeather]
StringIndex=3
UpdateDivider=-1

;

[MeterTemp]
MeasureName=MeasureWeatherTemp
Meter=STRING
X=2
Y=(2/#Scale#)r
MeterStyle=DisplayStyle1
FontSize=(30/#Scale#)
InlineSetting=Size | (16/#Scale#)
InlinePattern=F
Antialias=1
DynamicVariables=1
Hidden=#WeatherHidden#
UpdateDivider=-1

[MeterDesc]
MeasureName=MeasureWeatherDesc
Meter=STRING
X=(100/#Scale#)
Y=(8/#Scale#)r
MeterStyle=DisplayStyle1
FontSize=(14/#Scale#)
InlineSetting=Case | Upper
Antialias=1
DynamicVariables=1
Hidden=#WeatherHidden#
UpdateDivider=-1

[MeterWeatherHumidity]
MeasureName=MeasureWeatherHumidity
Meter=STRING
X=r
Y=(20/#Scale#)r
MeterStyle=DisplayStyle1
FontSize=(10/#Scale#)
Antialias=1
Text=Humidity: %1
DynamicVariables=1
Hidden=#WeatherHidden#
UpdateDivider=-1
Post Reply