It is currently April 19th, 2024, 9:04 pm

webparser regexp help - Solar Weather

Get help with creating, editing & fixing problems with skins
User avatar
xfgexo
Posts: 4
Joined: January 16th, 2017, 3:22 am
Location: Minnesota, USA

webparser regexp help - Solar Weather

Post by xfgexo »

Background:
I am working on a Solar Weather element for a Rainmeter skin i am working on. This is my first skin, and although i am new to this, I have learned much utilizing the Rainmeter docs, tutorials and searches. However, i seem to be stuck at the moment and was wondering if someone might be able to help me out.

Question:
Does Rainmeter Webparser plugin (Regexp) have the ability to search and locate data in a text file by line number or count the number of spaces/characters? Or possibly some other method i have not thought of yet?

Problem:
The problem is i am attempting to parse a text file but all the data in the text file keeps changing every 3 hours and there is no way to know ahead of time what the data will be and i only want specific data located near the end of the file.

What i have so far:
The text file i am parsing is made available by NASA which shows the last 30 days of geomagnetic data. However i am only interested in the last 3 days. The link to the text file is here. NASA also provides a graph which uses the data which can be found here. I have also attached an image to this post which shows the location of the data i am trying to utilize.

If i get part 1 working properly then i will begin working on part 2 which would involve using the data to create either my own bar graph in my skin or use specific images of my own design based on the data returned. But first things first.


Code: Select all

[Rainmeter]

;////////////////////////////////////////
;  Update every 3 hours
;////////////////////////////////////////

Update=10800

;////////////////////////////////////////
;  Parse Estimated Planetary K-indices
;////////////////////////////////////////

[KIndexValue]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=http://services.swpc.noaa.gov/text/daily-geomagnetic-indices.txt
RegExp="(?siU)4  1 1 1 1 1 2 2 1(.*)-1"
StringIndex=1

;////////////////////////////////////////
;  Set background image
;////////////////////////////////////////
[BackgroundImage]
Meter=Image
SolidColor=200,200,200,255
X=5
Y=5
W=575
H=100

;////////////////////////////////////////
;  Output KIndexValue to screen
;////////////////////////////////////////

[MeterKIdxText]
Meter=String
MeasureName=KIndexValue
X=40
Y=5
FontFace=Trebuchet MS
FontSize=10
FontColor=0,0,0,255
AntiAlias=1
Text=%1
Note 1:
I know my current Regexp search criteria will not last as it's simply using data that's currently in the text file which, will eventually be overwritten by a future update of the text file. However, i needed to start somewhere.

Note 2:
I know i could simply grab the image graph NASA provides however, the reason i am looking to parse the text file instead is so i can better customize the display of results for inclusion into the skin i am working on.
You do not have the required permissions to view the files attached to this post.
Earth orbiting a star, 300 billion stars in our galaxy, 100 billion galaxies, are we alone?
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: webparser regexp help - Solar Weather

Post by balala »

Try the following measures:

Code: Select all

[KIndexValue]
Measure=Plugin
Plugin=WebParser
URL=http://services.swpc.noaa.gov/text/daily-geomagnetic-indices.txt
RegExp=(?si)Product.*\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n.*

[KIndexValue1]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=1

[KIndexValue2]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=2

[KIndexValue3]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=3

[KIndexValue4]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=4

[KIndexValue5]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=5

[MeterKIdxText]
Meter=String
MeasureName=KIndexValue2
MeasureName2=KIndexValue3
MeasureName3=KIndexValue4
X=40
Y=5
FontFace=Trebuchet MS
FontSize=10
FontColor=0,0,0,255
AntiAlias=1
Text=1. %1#CRLF#2. %2#CRLF#3. %3
[KIndexValue5] will return the last line, with those -1s. [KIndexValue1] will return the content of the whole file, without the last four lines while [KIndexValue2], [KIndexValue3] and [KIndexValue4] the needed lines.
User avatar
xfgexo
Posts: 4
Joined: January 16th, 2017, 3:22 am
Location: Minnesota, USA

Re: webparser regexp help - Solar Weather

Post by xfgexo »

Thank you for the help. This helps me understand better. I should've been more attentive when looking over the various options for regular expressions as in the case with /n. However, instead of the entire line coming back, i am only interested in the last 8 digits of those 3 lines.

e.g.
KIndexValue2 currently returns:
2107 01 14 3 11101211 1 00200001 4 12101112

KIndexValue3 currently returns:
2017 01 15 2 10111110 3 00122110 5 21211121

KIndexValue4 currently returns:
2017 01 16 2 01101010 0 00100000 3 11100011

But i would like to grab just the last 8 digits from each of these lines
KIndexValue2 12101112
KIndexValue3 21211121
KIndexValue4 11100011

Each digit represents a geomagnetic level average for a 3 hour period. So for example, if we take KIndexValue2 and it was to just return 12101112
(The 1= level of activity on a 0-9 scale for the first 3 hours of that particular day.)
(The 2= level of activity on a 0-9 scale for the next 3 hours of that particular day.)
(Any occurrence of a digit coming back as a -1, just means, there is no data available for the period of time yet.)
and so on...

I am currently going back over the Rainmeter docs and the beginner and advanced tutorials for regular expressions to see if anything else might help be more specific about the data regexp grabs when its looking at those lines. On a plus side, the digits will always be either a -1 or 0 through 9
Earth orbiting a star, 300 billion stars in our galaxy, 100 billion galaxies, are we alone?
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: webparser regexp help - Solar Weather

Post by FreeRaider »

A solution

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[KIndexValue]
Measure=Plugin
Plugin=WebParser
URL=http://services.swpc.noaa.gov/text/daily-geomagnetic-indices.txt
RegExp=(?si)Product.*\n(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n.*

[KIndexValue1]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=1
RegExp="(?si)^.*\d\s{3,5}\d+\s+(.*)$"
StringIndex2=1

[KIndexValue2]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=2
RegExp="(?si)^.*\d\s{3,5}\d+\s+(.*)$"
StringIndex2=1

[KIndexValue3]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=3
RegExp="(?si)^.*\d\s{3,5}\d+\s+(.*)$"
StringIndex2=1

[KIndexValue4]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=4
RegExp="(?si)^.*\d\s{3,5}\d+\s+(.*)$"
StringIndex2=1

[KIndexValue5]
Measure=Plugin
Plugin=WebParser
URL=[KIndexValue]
StringIndex=5
RegExp="(?si)^.*\d\s{3,5}\d+\s+(.*)$"
StringIndex2=1

[MeterKIdxText]
Meter=String
MeasureName=KIndexValue2
MeasureName2=KIndexValue3
MeasureName3=KIndexValue4
X=40
Y=5
FontFace=Trebuchet MS
FontSize=10
FontColor=0,0,0,255
AntiAlias=1
Text=1. %1#CRLF#2. %2#CRLF#3. %3
I have used StringIndex2.

Have a look at it and also at how you can use it.

I hope this helps you.
User avatar
xfgexo
Posts: 4
Joined: January 16th, 2017, 3:22 am
Location: Minnesota, USA

Re: webparser regexp help - Solar Weather

Post by xfgexo »

So basically, we use the first regex to grab and group the data that it returns from the text file. Then we use a handy little feature, StringIndex2 to run another regex on the data that was returned from the first regex? Then repeat as necessary.

This is great, thank you for the help, very much appreciated.
Earth orbiting a star, 300 billion stars in our galaxy, 100 billion galaxies, are we alone?
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: webparser regexp help - Solar Weather

Post by FreeRaider »

xfgexo wrote:So basically, we use the first regex to grab and group the data that it returns from the text file. Then we use a handy little feature, StringIndex2 to run another regex on the data that was returned from the first regex? Then repeat as necessary.
Basically, it is correct.


xfgexo wrote:This is great, thank you for the help, very much appreciated.
Glad to help!
User avatar
xfgexo
Posts: 4
Joined: January 16th, 2017, 3:22 am
Location: Minnesota, USA

Re: webparser regexp help - Solar Weather

Post by xfgexo »

Well after getting a much needed nudge in the right direction from balala and FreeRaider 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.

Question1?
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.

Question 2?
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
Earth orbiting a star, 300 billion stars in our galaxy, 100 billion galaxies, are we alone?
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: webparser regexp help - Solar Weather

Post by fonpaolo »

For your questions, if there's only one "master" measure and all the others are bound at it, you can set UpdateDivider=-1 to all the other measure and the corresponding meters, add a Group=WebMeasures to the measures, add also a Group=WebMeters to the meters and a FinishAction=[!UpdateMeasureGroup WebMeasures][!UpdateMeterGroup WebMeters][!Redraw] to the "master" measure to update everything only when it's necessary.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: webparser regexp help - Solar Weather

Post by FreeRaider »

In my opionion, you can use directly Update=3600000 (one hour in milliseconds if I am right) under Rainmeter section and UpdateRate = -1 under ... Wait a second! I see that you are using multiple measures to capture the days and K-index values in a separate way.
Anyhow, UpdateRate = - 1 in every measure (where you have URL=YOUR/SITE/HERE) should be for you.


By the way, have a look at the update guide
ScottK
Posts: 12
Joined: August 18th, 2017, 8:37 am

Re: webparser regexp help - Solar Weather

Post by ScottK »

Has a working skin been posted for this yet? If not, I'd like to play around with it.

Thanks!