I have managed to get it working.
However, now i am trying to find ways that i can optimize the code without breaking it. I am sure a regex guru could probably find ways to simplify my regular expressions, however i am more interested right now in the whole Update/Update Rate/ Update Divider thing.
Currently i have the [Rainmeter] section at a default of Update=1000 and the Webparser plugin measure that connects to the internet set to UpdateRate=3600. (1 Hour) This is because of the long times between updates to the text file from NOAA.
Should i set the UpdateRate for all the other Webparser plugin measures i have as well? They are simply getting their value from the first Webparser plugin measure that connects to the internet.
Should i set the UpdateDivider for the meters as well? Nothing in this ini file needs to be refreshed or calculated any sooner then once per hour.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Metadata]
Name=Estimated Planetary K-indices
Author=Joel Porter
Information=Skin to display current disturbances in the Earth's magnetic field. | Each bar represents 3 hours time with a range scale of 0 to 9.
Version=1.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
;//////////////////////////////////////////
; DAY 1 DATA
;//////////////////////////////////////////
[Day1KIndexValue]
Measure=Plugin
Plugin=WebParser
URL=http://services.swpc.noaa.gov/text/daily-geomagnetic-indices.txt
;URL=file://C:\daily-geomagnetic-indices.txt
RegExp=(?si)Product.*\n(.*)\n(.*)\n(.*)\n(.*)
UpdateRate=3600
[Day1KIndexValue1]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue]
StringIndex=1
RegExp="(?si)^.*\d\s{3,5}\d+\s+(.*)$"
StringIndex2=1
[Day1KIndexValue2]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue1]
StringIndex=1
RegExp="(?si)^.*\d\s\d\s\d\s\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
Percentual=1
MinValue=0
MaxValue=9
[Day1KIndexValue3]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day1KIndexValue4]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day1KIndexValue5]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day1KIndexValue6]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day1KIndexValue7]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day1KIndexValue8]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day1KIndexValue9]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue1]
StringIndex=1
RegExp="(?si)^(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
;//////////////////////////////////////////
; DAY 1 DATA - OUTPUT TO SCREEN
;//////////////////////////////////////////
[Day1KIndexValueText]
Meter=String
MeasureName=Day1KIndexValue1
MeasureName2=Day1KIndexValue2
MeasureName3=Day1KIndexValue3
MeasureName4=Day1KIndexValue4
MeasureName5=Day1KIndexValue5
MeasureName6=Day1KIndexValue6
MeasureName7=Day1KIndexValue7
MeasureName8=Day1KIndexValue8
MeasureName9=Day1KIndexValue9
X=0
Y=70
FontSize=8
FontColor=250,255,255,255
AntiAlias=1
Text=%9 %8 %7 %6 %5 %4 %3 %2
[Day1KIndexValueBar9]
MeasureName=Day1KIndexValue9
Meter=Bar
X=0
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day1KIndexValueBar8]
MeasureName=Day1KIndexValue8
Meter=Bar
X=11
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day1KIndexValueBar7]
MeasureName=Day1KIndexValue7
Meter=Bar
X=22
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day1KIndexValueBar6]
MeasureName=Day1KIndexValue6
Meter=Bar
X=34
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day1KIndexValueBar5]
MeasureName=Day1KIndexValue5
Meter=Bar
X=46
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day1KIndexValueBar4]
MeasureName=Day1KIndexValue4
Meter=Bar
X=58
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day1KIndexValueBar3]
MeasureName=Day1KIndexValue3
Meter=Bar
X=70
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day1KIndexValueBar2]
MeasureName=Day1KIndexValue2
Meter=Bar
X=82
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
;//////////////////////////////////////////
; DAY 2 DATA
;//////////////////////////////////////////
[Day2KIndexValue]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue]
;URL=http://services.swpc.noaa.gov/text/daily-geomagnetic-indices.txt
;URL=file://C:\daily-geomagnetic-indices.txt
RegExp=(?si)Product.*\n(.*)\n(.*)\n(.*)
UpdateRate=3600
[Day2KIndexValue1]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue]
StringIndex=1
RegExp="(?si)^.*\d\s{3,5}\d+\s+(.*)$"
StringIndex2=1
[Day2KIndexValue2]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue1]
StringIndex=1
RegExp="(?si)^.*\d\s\d\s\d\s\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
Percentual=1
MinValue=0
MaxValue=9
[Day2KIndexValue3]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day2KIndexValue4]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day2KIndexValue5]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day2KIndexValue6]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day2KIndexValue7]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day2KIndexValue8]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day2KIndexValue9]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue1]
StringIndex=1
RegExp="(?si)^(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
;//////////////////////////////////////////
; DAY 2 DATA - OUTPUT TO SCREEN
;//////////////////////////////////////////
[KIndexValueText]
Meter=String
MeasureName=Day2KIndexValue1
MeasureName2=Day2KIndexValue2
MeasureName3=Day2KIndexValue3
MeasureName4=Day2KIndexValue4
MeasureName5=Day2KIndexValue5
MeasureName6=Day2KIndexValue6
MeasureName7=Day2KIndexValue7
MeasureName8=Day2KIndexValue8
MeasureName9=Day2KIndexValue9
X=100
Y=70
FontSize=8
FontColor=255,255,255,255
AntiAlias=1
Text=%9 %8 %7 %6 %5 %4 %3 %2
[Day2KIndexValueBar9]
MeasureName=Day2KIndexValue9
Meter=Bar
X=100
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day2KIndexValueBar8]
MeasureName=Day2KIndexValue8
Meter=Bar
X=111
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day2KIndexValueBar7]
MeasureName=Day2KIndexValue7
Meter=Bar
X=122
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day2KIndexValueBar6]
MeasureName=Day2KIndexValue6
Meter=Bar
X=134
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day2KIndexValueBar5]
MeasureName=Day2KIndexValue5
Meter=Bar
X=146
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day2KIndexValueBar4]
MeasureName=Day2KIndexValue4
Meter=Bar
X=158
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day2KIndexValueBar3]
MeasureName=Day2KIndexValue3
Meter=Bar
X=170
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day2KIndexValueBar2]
MeasureName=Day2KIndexValue2
Meter=Bar
X=182
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
;//////////////////////////////////////////
; DAY 3 DATA
;//////////////////////////////////////////
[Day3KIndexValue]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue]
;URL=http://services.swpc.noaa.gov/text/daily-geomagnetic-indices.txt
;URL=file://C:\daily-geomagnetic-indices.txt
RegExp=(?si)Product.*\n(.*)\n(.*)
UpdateRate=3600
[Day3KIndexValue1]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue]
StringIndex=1
RegExp="(?si)^.*\d\s{3,5}\d+\s+(.*)$"
StringIndex2=1
[Day3KIndexValue2]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue1]
StringIndex=1
RegExp="(?si)^.*\d\s\d\s\d\s\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
Percentual=1
MinValue=0
MaxValue=9
[Day3KIndexValue3]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day3KIndexValue4]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day3KIndexValue5]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day3KIndexValue6]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day3KIndexValue7]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day3KIndexValue8]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue1]
StringIndex=1
RegExp="(?si)^\d\s(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
[Day3KIndexValue9]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue1]
StringIndex=1
RegExp="(?si)^(\d)"
StringIndex2=1
MinValue=0
MaxValue=9
;//////////////////////////////////////////
; DAY 3 DATA - OUTPUT TO SCREEN
;//////////////////////////////////////////
[Day3KIndexValueText]
Meter=String
MeasureName=Day3KIndexValue1
MeasureName2=Day3KIndexValue2
MeasureName3=Day3KIndexValue3
MeasureName4=Day3KIndexValue4
MeasureName5=Day3KIndexValue5
MeasureName6=Day3KIndexValue6
MeasureName7=Day3KIndexValue7
MeasureName8=Day3KIndexValue8
MeasureName9=Day3KIndexValue9
X=200
Y=70
FontSize=8
FontColor=255,255,255,255
AntiAlias=1
Text=%9 %8 %7 %6 %5 %4 %3 %2
[Day3KIndexValueBar9]
MeasureName=Day3KIndexValue9
Meter=Bar
X=200
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day3KIndexValueBar8]
MeasureName=Day3KIndexValue8
Meter=Bar
X=211
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day3KIndexValueBar7]
MeasureName=Day3KIndexValue7
Meter=Bar
X=222
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day3KIndexValueBar6]
MeasureName=Day3KIndexValue6
Meter=Bar
X=234
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day3KIndexValueBar5]
MeasureName=Day3KIndexValue5
Meter=Bar
X=246
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day3KIndexValueBar4]
MeasureName=Day3KIndexValue4
Meter=Bar
X=258
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day3KIndexValueBar3]
MeasureName=Day3KIndexValue3
Meter=Bar
X=270
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
[Day3KIndexValueBar2]
MeasureName=Day3KIndexValue2
Meter=Bar
X=282
Y=15
W=8
H=50
BarColor=185,250,160,255
SolidColor=150,150,150,255
BarOrientation=Vertical
;//////////////////////////////////////////
; DAY 1 DATE
;//////////////////////////////////////////
[Day1KIndexDate]
Measure=Plugin
Plugin=WebParser
URL=[Day1KIndexValue]
StringIndex=1
RegExp="(?si)(^\d\d\d\d\s\d\d\s\d\d)"
StringIndex2=1
UpdateRate=3600
;//////////////////////////////////////////
; DAY 1 DATE - OUTPUT TO SCREEN
;//////////////////////////////////////////
[Day1KIndexDateText]
Meter=String
MeasureName=Day1KIndexDate
X=15
Y=0
FontSize=8
FontColor=255,255,255,255
AntiAlias=1
Text=%1
;//////////////////////////////////////////
; DAY 2 DATE
;//////////////////////////////////////////
[Day2KIndexDate]
Measure=Plugin
Plugin=WebParser
URL=[Day2KIndexValue]
StringIndex=1
RegExp="(?si)(^\d\d\d\d\s\d\d\s\d\d)"
StringIndex2=1
UpdateRate=3600
;//////////////////////////////////////////
; DAY 2 DATE - OUTPUT TO SCREEN
;//////////////////////////////////////////
[Day2KIndexDateText]
Meter=String
MeasureName=Day2KIndexDate
X=115
Y=0
FontSize=8
FontColor=255,255,255,255
AntiAlias=1
Text=%1
;//////////////////////////////////////////
; DAY 3 DATE
;//////////////////////////////////////////
[Day3KIndexDate]
Measure=Plugin
Plugin=WebParser
URL=[Day3KIndexValue]
StringIndex=1
RegExp="(?si)(^\d\d\d\d\s\d\d\s\d\d)"
StringIndex2=1
UpdateRate=3600
;//////////////////////////////////////////
; DAY 3 DATE - OUTPUT TO SCREEN
;//////////////////////////////////////////
[Day3KIndexDateText]
Meter=String
MeasureName=Day3KIndexDate
X=215
Y=0
FontSize=8
FontColor=255,255,255,255
AntiAlias=1
Text=%1