It is currently March 28th, 2024, 2:49 pm

Need help with replacing part of code to show Weather Temperature instead

Get help with creating, editing & fixing problems with skins
Mordecai7562
Posts: 9
Joined: March 13th, 2018, 4:44 am

Need help with replacing part of code to show Weather Temperature instead

Post by Mordecai7562 »

This code is normally supposed to show cpu usage and ram usage, but I successfully changed the ram into showing the battery percentage.
However, I want to change the cpu usage information to be the current temperature. I've been trying for a few hours and no luck, I've been trying to borrow code from other weather skins to see if I can get something to work, but no luck.

Here's the code I currently have. Any suggestions as to use the weather site instead of cpu usage?
Thanks in advance.

Code: Select all

[Variables]
FontName=Cartoonist
FontHeight=28
AntiAlias=1

[Background]
Meter=IMAGE
ImageName=ramcpu2.png
AntiAlias=1

[MeasureCPU]
Measure=CPU
RegExpSubstitute=1
Substitute="^(\d\d)$":"0\0","^(\d)$":"00\0"

[MeasureBATT]
Measure=Plugin
Plugin=PowerPlugin
PowerState=Percent
RegExpSubstitute=1
Substitute="^(\d\d)$":"0\0","^(\d)$":"00\0"


[Label CPU]
Meter=STRING
X=0
Y=0
FontColor=#FontColor#
FontFace=#FontName#
FontSize=#FontHeight#
StringAlign=LEFT
StringStyle=Italic
StringEffect=Border
FontEffectColor=206, 134, 99, 160
AntiAlias=1

[Label BATT]
Meter=STRING
X=28
Y=55
FontColor=#FontColor#
FontFace=#FontName#
FontSize=#FontHeight#
StringAlign=LEFT
StringStyle=Italic
StringEffect=Border
FontEffectColor=206, 134, 99, 160
AntiAlias=1


[CPU]
Meter=STRING
MeasureName=MeasureCPU
X=123
Y=150
FontColor=106,254,221
FontFace=#FontName#
FontSize=#FontHeight#
StringAlign=RIGHT
StringStyle=Italic
AntiAlias=1
Text="%1"
Angle=(Rad(-11))

[BATT]
Meter=STRING
MeasureName=MeasureBATT
X=208
Y=134
FontColor=254,100,231
FontFace=#FontName#
FontSize=#FontHeight#
StringAlign=RIGHT
StringStyle=Italic
AntiAlias=1
Text="%1"
Percentual=1
AutoScale=1
Angle=(Rad(-11))

[MeterBar]
MeasureName=MeasureCPU
Meter=BAR
X=62
Y=177
W=150
H=5
BarOrientation=HORIZONTAL
BarImage=cpupersona.png

[MeterBar2]
MeasureName=MeasureBATT
Meter=BAR
X=84
Y=184
W=150
H=5
BarOrientation=HORIZONTAL
BarImage=rampersona.png
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Need help with replacing part of code to show Weather Temperature instead

Post by SilverAzide »

Your code is missing 99.9% of what you are going to need to do a weather skin. My suggestion is to find a weather skin you like and use it as your starting point, not this. Weather skins are a lot more complicated than a CPU skin, as you need to use WebParser measures and lots of regex string substitutions. A good starting point to learn from is JSMorley's JSMeter VIII suite.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Need help with replacing part of code to show Weather Temperature instead

Post by eclectic-tech »

Converting a CPU skin is not the way to do this; you can use the meter styles, but the data measuring is completely different.
CPU skins measures 3-4 items while weather skins can measure 30-40! :uhuh:

I would highly recommend starting with JSMorley's Weather Skin Tutorial. :17readbook

Weather skins can be complicated so the approach taken in the tutorial will greatly simplify gathering all the weather data and let you can pick the items you want to put in your meters that match the style you posted. :thumbup:

If you need more help, post your question(s) here, and someone here can help. :welcome:
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help with replacing part of code to show Weather Temperature instead

Post by balala »

eclectic-tech wrote:CPU skins measures 3-4 items while weather skins can measure 30-40! :uhuh:
Sorry eclectic-tech, but if Mordecai7562 needs just the current temperature, that's not so hard and doesn't require 30-40 items at all.
Mordecai7562 wrote:However, I want to change the cpu usage information to be the current temperature. I've been trying for a few hours and no luck, I've been trying to borrow code from other weather skins to see if I can get something to work, but no luck.
If you want to get just the current temperature, that's not so hard at all. You need a few variables and just one single WebParser measure, which gets it.
So replace the [MeasureCPU] measure with the following one:

Code: Select all

[MeasureCPU]
Measure=Plugin
Plugin=WebParser
UpdateRate=900
Url=http://wxdata.weather.com/wxdata/weather/local/#WeatherLocation#?cc=*&unit=#Unit#&dayf=1
RegExp=(?siU)<cc>.*<tmp>(.*)</tmp>.*</cc>
StringIndex=1
MinValue=
MaxValue=
This measure returns the current temperature. But to make it to work, you have to define in the [Variables] section of your code the WeatherLocation and the Unit variables. WeatherLocation is the weather code of your location and can be found here: https://weather.codes/. Just enter the name of your location and choose a code from the results. This code must contain four letters and four digits. Unit can be either m (if you want to get the temperatures in Celsius degrees), or i (for temperatures in Fahrenheit degrees).
Define both variables of them in the [Variables] section:

Code: Select all

[Variables]
...
WeatherLocation=ENETER-HERE-THE-CODE-FOUND-ON-THE-ABOVE-WEBSITE
Unit=m OR i
The MinValue and MaxValue options added to the [MeasureCPU] measure are the limits of the temperature (the lowest and the largest possible temperature). They are needed because the skin has a Bar meter, and a such meter uses percentual values. For such calculations these options have to be defined on the measure. Their values depends mostly on what temperature unit are you using.
Finally if you get all these working, I'd suggest to replace the [MeasureCPU] name with a [MeasureTemp], or something similar, to not create confusions later. If you do so, there also will be needed to replace all occurrences of the MeasureCPU name with MeasureTemp (eg in the [CPU] and [MeterBar] meters).
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need help with replacing part of code to show Weather Temperature instead

Post by jsmorley »

I think eclectic-tech's point wasn't that this particular skin would require a ton of WebParser measures, but that in general, it may not be the best approach to try and convert a skin like a CPU skin, or a Network skin, or a Gmail skin, into a weather skin. You need entirely different, and quite often many more, measures, and the meters are seldom going to work or look right just as they are.

For instance, a Bar meter in a CPU skin, based on a percentage from 0 to 100 percent, is a useful thing. That is how you think about CPU usage. Temperature displayed as 0 to 100 percent? That isn't how you think about temperatures. "The current temperature is 67%" is not terribly useful information, particularly since the lower end of the range is a negative number. What you want in order to use a Bar meter with temperature is a "thermometer", that displays the value on a graduated scale of temperatures, with the graduations clearly labeled. It's generally not a good one-to-one replacement.

There is no right or wrong here, but I'd be tempted to start a weather skin from scratch, and get it returning the values you want to use. Then liberally "steal" cosmetics from the other skin. Maybe Shape meters, or color variables, or images, or font attributes or whatever it is you like about the older skin.
Mordecai7562
Posts: 9
Joined: March 13th, 2018, 4:44 am

Re: Need help with replacing part of code to show Weather Temperature instead

Post by Mordecai7562 »

Thanks, that worked. Temperature updated automatically.

Now another problem I'm having is that it's snowing but I'm not getting any snow icon on my weather widget. I don't know what to name the icons to show it, or which [!RainmeterShowMeter] variable name to use.

EDIT: sorry, should put code in:

Code: Select all

[Variables]
Location=Milwaukee,Wisconsin

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


[Main]
	Meter=IMAGE
	ImageName=Res\PersonaBG.png
	x=-10
	y=-50

[TimeOfDay]
	Measure=Time
	Format=%H
	StringStyle=BOLD

[MeasureTime]
Measure=Time

[MeasureDayNUM]
Measure=Time
Format=%#d

[MeasureMonthNUM]
Measure=Time
Format=%#m

[MeasureDay]
Measure=Time
Format=%#A

[EarlyMorning]
Meter=IMAGE
ImageName=Res\EarlyMorning.png
x=55
y=190
Hidden=1

[Morning]
Meter=IMAGE
ImageName=Res\Morning.png
Hidden=1
x=45
y=180

[Daytime]
Meter=IMAGE
ImageName=res\Daytime.png
Hidden=1
x=50
y=200

[Afternoon]
Meter=IMAGE
ImageName=Res\Afternoon.png
Hidden=1
x=50
y=200

[Evening]
Meter=IMAGE
ImageName=Res\Evening.png
Hidden=1
x=35
y=185

[Night]
Meter=IMAGE
ImageName=Res\Night.png
Hidden=1
x=20
y=200

[Midnight]
Meter=IMAGE
ImageName=Res\Midnight.png
Hidden=1
x=-140
y=160

;------BEGIN PASTA--------
;Code modified from anelectricQlock by anelectricmind.
;-------------------------

[measureMinute]
; returns minutes
Measure=Time
Format=%M

[measureHour]
; returns hour
Measure=Time
Format=%H

[measureHourAjusted]
Measure=calc
Formula= ( (measureHour > 12) ? (measureHour) : (measureHour) )

[measureHour_One]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 1
IfEqualAction=!Execute [!RainmeterShowMeter Night] [!RainmeterShowMeter Rain] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Fog] [!RainmeterHideMeter Morning] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Midnight]  

[measureHour_Two]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 2
IfEqualAction=!Execute [!RainmeterShowMeter Night] [!RainmeterShowMeter Rain] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Fog] [!RainmeterHideMeter Morning] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Midnight]  

[measureHour_Three]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 3 
IfEqualAction=!Execute [!RainmeterHideMeter Night] [!RainmeterShowMeter Rain] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Fog] [!RainmeterHideMeter Morning] [!RainmeterShowMeter EarlyMorning] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Midnight]  

[measureHour_Four]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 4
IfEqualAction=!Execute [!RainmeterShowMeter EarlyMorning]  [!RainmeterHideMeter Midnight] [!RainmeterHideMeter Morning] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] 

[measureHour_Five]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 5
IfEqualAction=!Execute [!RainmeterShowMeter EarlyMorning]  [!RainmeterHideMeter Midnight] [!RainmeterHideMeter Morning] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] 

[measureHour_Six]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 6
IfEqualAction=!Execute [!RainmeterShowMeter Morning] [!RainmeterHideMeter EarlyMorning]  [!RainmeterHideMeter Rain] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight]

[measureHour_Seven]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 7
IfEqualAction=!Execute [!RainmeterShowMeter Morning] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Sun] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight]

[measureHour_Eight]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 8
IfEqualAction=!Execute [!RainmeterShowMeter Morning] [!RainmeterShowMeter Fog] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight] 

[measureHour_Nine]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 9
IfEqualAction=!Execute [!RainmeterShowMeter Morning] [!RainmeterShowMeter Rain] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Fog] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight] 

[measureHour_Ten]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 10
IfEqualAction=!Execute [!RainmeterHideMeter Morning] [!RainmeterShowMeter Sun] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter EarlyMorning]  [!RainmeterHideMeter Rain] [!RainmeterShowMeter Daytime] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight]

[measureHour_Eleven]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 11
IfEqualAction=!Execute [!RainmeterHideMeter Morning] [!RainmeterShowMeter Cloud] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Sun] [!RainmeterShowMeter Daytime] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight] 

[measureHour_Twelve]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 12
IfEqualAction=!Execute [!RainmeterShowMeter Daytime] [!RainmeterShowMeter Fog] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight]

[measureHour_Thirteen]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 13
IfEqualAction=!Execute [!RainmeterShowMeter Daytime] [!RainmeterShowMeter Rain] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Fog] [!RainmeterHideMeter Morning] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight] 

[measureHour_Fourteen]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 14
IfEqualAction=!Execute [!RainmeterHideMeter Daytime] [!RainmeterShowMeter Sun] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter Rain] [!RainmeterHideMeter EarlyMorning] [!RainmeterShowMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight]  

[measureHour_Fifteen]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 15
IfEqualAction=!Execute [!RainmeterShowMeter Afternoon] [!RainmeterShowMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter Sun] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight] [!RainmeterHideMeter Daytime] 

[measureHour_Sixteen]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 16
IfEqualAction=!Execute [!RainmeterShowMeter Afternoon] [!RainmeterShowMeter Fog] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Daytime]  [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight]  

[measureHour_Seventeen]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 17
IfEqualAction=!Execute [!RainmeterShowMeter Evening] [!RainmeterShowMeter Rain] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Fog] [!RainmeterHideMeter Morning] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime]  [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight] 

[measureHour_Eighteen]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 18
IfEqualAction=!Execute [!RainmeterShowMeter Evening] [!RainmeterShowMeter Sun] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter Rain] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime]  [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Night] [!RainmeterHideMeter Midnight]  

[measureHour_Ninteen]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 19
IfEqualAction=!Execute [!RainmeterHideMeter Evening] [!RainmeterShowMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter Sun] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime]  [!RainmeterHideMeter Afternoon] [!RainmeterShowMeter Night] [!RainmeterHideMeter Midnight] 

[measureHour_Twenty]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 20
IfEqualAction=!Execute [!RainmeterHideMeter Evening] [!RainmeterShowMeter Fog] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime]  [!RainmeterHideMeter Afternoon] [!RainmeterShowMeter Night] [!RainmeterHideMeter Midnight]  

[measureHour_TwentyOne]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 21
IfEqualAction=!Execute [!RainmeterShowMeter Night] [!RainmeterShowMeter Rain] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Fog] [!RainmeterHideMeter Morning] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime]  [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Midnight]  

[measureHour_TwentyTwo]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 22
IfEqualAction=!Execute [!RainmeterShowMeter Night] [!RainmeterShowMeter Sun] [!RainmeterHideMeter Daytime] [!RainmeterHideMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter Rain] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Daytime]  [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Midnight]

[measureHour_TwentyThree]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 23
IfEqualAction=!Execute [!RainmeterShowMeter Night] [!RainmeterShowMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter Sun] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Daytime]  [!RainmeterHideMeter Midnight] 

[measureHour_TwentyZero]
Measure=calc
Formula=measureHourAjusted
IfEqualValue = 0
IfEqualAction=!Execute [!RainmeterShowMeter Night] [!RainmeterShowMeter Cloud] [!RainmeterHideMeter Morning] [!RainmeterHideMeter Sun] [!RainmeterHideMeter EarlyMorning] [!RainmeterHideMeter Afternoon] [!RainmeterHideMeter Evening] [!RainmeterHideMeter Daytime]  [!RainmeterHideMeter Midnight] 

;-------------------Meter Date------------------------
;Author: Dartemil
;-----------------------------------------------------



[ImageDayNUM]
Meter=Image
ImageName=day\[MeasureDayNUM].png
X=140
y=40
ImageRotate=-15
DynamicVariables=1

[ImageMonthNUM]
Meter=Image
X=60
Y=95
ImageRotate=-15
ImageName=Months\[MeasureMonthNUM].png
DynamicVariables=1



;-------------------Meter Day------------------------
;Author: Dartemil
;-----------------------------------------------------

[ImageDay]
Meter=Image
ImageName=Days\[MeasureDay].png
X=200
Y=130
ImageRotate=-15
DynamicVariables=1

;====================================
;
;     WEATHER UNDERGROUND CODE
;All data provided by Weather Underground
;
;http://www.wunderground.com/
;Original Author=maminscris  http://maminscris.deviantart.com/
;Original CoAuthor=Yelleke   http://yelleke.deviantart.com/
;
;====================================


[MeasureWunder]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1200
Url=http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=#Location#
RegExp="(?siU)<display_location>.*<city>(.*)</city>.*</display_location>.*<observation_time>Last Updated on (.*), (.*) (.*)</observation_time>.*<weather>(.*)</weather>.*<temp_c>(.*)</temp_c>.*<relative_humidity>(.*)</relative_humidity>.*<wind_dir>(.*)</wind_dir>.*<wind_mph>(.*)</wind_mph>.*<pressure_mb>(.*)</pressure_mb>.*<dewpoint_c>(.*)</dewpoint_c>.*<icon>(.*)</icon>"




[MeasureCurConditions]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWunder]
StringIndex=5

[MeasureCurIcon]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWunder]
StringIndex=12

[MeterCurIcon]

Meter=IMAGE
MeasureName=MeasureCurIcon
X=288
Y=55
H=75
W=75
ImageRotate=-15
Path=icons\
LeftMouseUpAction=!Execute [!RainmeterRefresh]

[MeasureWunderForecast]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1000
Url=http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=#Location#
RegExp="(?siU)<period>1</period>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>"
Debug=1

[MeasureWunderPollen]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1000
Url=http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=#Location#
RegExp="(?siU)<period>1</period>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>.*<weekday>(.*)</weekday>.*<high>.*<celsius>(.*)</celsius>.*</high>.*<low>.*<celsius>(.*)</celsius>.*</low>.*<conditions>(.*)</conditions>.*<icon>(.*)</icon>"
Debug=1
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help with replacing part of code to show Weather Temperature instead

Post by balala »

Mordecai7562 wrote:Thanks, that worked. Temperature updated automatically.
What exactly did work?
Mordecai7562 wrote:Now another problem I'm having is that it's snowing but I'm not getting any snow icon on my weather widget. I don't know what to name the icons to show it, or which [!RainmeterShowMeter] variable name to use.
If you're using the solution I've described above, that doesn't return any icon, it returns just the temperature. So, I'm not sure what are we talking about.
Mordecai7562
Posts: 9
Joined: March 13th, 2018, 4:44 am

Re: Need help with replacing part of code to show Weather Temperature instead

Post by Mordecai7562 »

No, it's for a completely different thing. I put the code in as an edit
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help with replacing part of code to show Weather Temperature instead

Post by balala »

Mordecai7562 wrote:No, it's for a completely different thing. I put the code in as an edit
Yep, I saw in the meantime.
Mordecai7562 wrote:Now another problem I'm having is that it's snowing but I'm not getting any snow icon on my weather widget. I don't know what to name the icons to show it, or which [!RainmeterShowMeter] variable name to use.
You should have to have some .png files in a folder called icons, placed into your config, having the same names as the strings returned by the [MeasureCurIcon] measure. Eg for this moment you should have to have an image called snow.png. If you would have it, it would be shown, on your skin.
Similarly, you should have to have one image file for each possible condition. As I'm not using api.wunderground.com, I can't tell how each condition is named, but the basic idea is that you have to have those images. Do you have them?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need help with replacing part of code to show Weather Temperature instead

Post by jsmorley »

Mordecai7562 wrote:No, it's for a completely different thing. I put the code in as an edit
I firmly contend that nibbling at an existing skin isn't the right way to go with this. First, tell us what elements of the weather you want to use. If we know that, we can help you get all the elements you want from the feed, deal with the icon number/image, and then help with how you might display the results.

This will be painful if we do this one bit at a time. A little advanced planning, knowing what you want to use / display will help a lot and make it easier to do.
Post Reply