It is currently December 14th, 2018, 8:23 pm

Unexpected/Missing results using lookahead

Help with creating, editing & fixing problems with skins
Tical84
Posts: 14
Joined: November 24th, 2018, 9:34 pm

Unexpected/Missing results using lookahead

Tical84 » November 24th, 2018, 10:36 pm

Hi,
I've been searching for days but haven't been able to find the solution. I'm trying to grab NHL teams and scores from an XML (JSON CSV and XSD are also available if that's a better option) and it formats it like this:

Code: Select all

<awayTeam>
<id>17</id>
<abbreviation>STL</abbreviation>
</awayTeam>
<homeTeam>
<id>20</id>
<abbreviation>CHI</abbreviation>
</homeTeam>
<venue>
<id>28</id>
<name>United Center</name>
</venue>
<venueAllegiance>HOME</venueAllegiance>
<scheduleStatus>NORMAL</scheduleStatus>
<originalStartTime xsi:nil="true"/>
<delayedOrPostponedReason xsi:nil="true"/>
<playedStatus>COMPLETED</playedStatus>
<attendance xsi:nil="true"/>
<officials/>
<broadcasters/>
<weather xsi:nil="true"/>
</schedule>
<score>
<currentPeriod xsi:nil="true"/>
<currentPeriodSecondsRemaining xsi:nil="true"/>
<currentIntermission xsi:nil="true"/>
<awayScoreTotal>0</awayScoreTotal>
<awayShotsTotal>28</awayShotsTotal>
<homeScoreTotal>1</homeScoreTotal>
<homeShotsTotal>19</homeShotsTotal>
Because I don't want to have to know how many games are being played each day, I'm using lookahead and from looking at https://docs.rainmeter.net/tips/webparser-lookahead-assertions-in-regexp/ my dirty "testing" code looks like this:

Code: Select all

[Variables]
HomeTeam=(?(?=.*<homeTeam>).*<abbreviation>(.*)</abbreviation>)
AwayScore=(?(?=.*<score>).*<awayScoreTotal>(.*)</awayScoreTotal>)
AwayTeam=(?(?=.*<awayTeam>).*<abbreviation>(.*)</abbreviation>)
HomeScore=(?(?=.*<score>).*<homeScoreTotal>(.*)</homeScoreTotal>)

[MeasureNHL] 
Measure=Plugin 
Plugin=WebParser 
Header=Authorization: Basic REDACTED
URL=REDACTED
RegExp=(?siU)#AwayTeam##HomeTeam##AwayScore##HomeScore##AwayTeam##HomeTeam##AwayScore##HomeScore# etc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 1;;;;;;;;;;;;;;;;;;
[MeasureGame1AwayTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=1

[MeterGame1AwayTeam]
Meter=String
MeasureName=MeasureGame1AwayTeam
x=25
y=25
w=50
h=25
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame1HomeTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=2

[MeterGame1HomeTeam]
Meter=String
MeasureName=MeasureGame1HomeTeam
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame1AwayScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=3

[MeterGame1AwayScore]
Meter=String
MeasureName=MeasureGame1AwayScore
x=50r
y=25
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame1HomeScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=4

[MeterGame1HomeScore]
Meter=String
MeasureName=MeasureGame1HomeScore
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1
Everything works fine like this but the last team and last score never shows up. In the example I'm using there were 4 games. I get 7 teams and 7 scores with a single "Not enough substrings" error. Any ideas on why the last team and score doesn't show up? I can post the entire thing in case it's just a typo or something but I'm sure I've checked it a million times and it's basically copy/paste with just the meter/measure game# and stringindex# changed.

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

Re: Unexpected/Missing results using lookahead

balala » November 24th, 2018, 10:43 pm

Would be great if you'd give us the used URL.
Tical84
Posts: 14
Joined: November 24th, 2018, 9:34 pm

Re: Unexpected/Missing results using lookahead

Tical84 » November 24th, 2018, 10:48 pm

It requires a username and password that is not mine to give out. Can I paste the entire XML and you can save the contents locally?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3053
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Unexpected/Missing results using lookahead

eclectic-tech » November 25th, 2018, 12:14 am

Tical84 wrote:
November 24th, 2018, 10:48 pm
It requires a username and password that is not mine to give out. Can I paste the entire XML and you can save the contents locally?
The complete XML may help; I suspect you are missing an initial capture(s) which generates the error message concerning not enough substrings. :???:
Tical84
Posts: 14
Joined: November 24th, 2018, 9:34 pm

Re: Unexpected/Missing results using lookahead

Tical84 » November 25th, 2018, 12:39 am

Code: Select all

<gam:iceHockeyGames>
<lastUpdatedOn>2018-11-15T13:13:27.951Z</lastUpdatedOn>
<games>
<schedule>
<id>46571</id>
<startTime>2018-11-15T01:00:00.000Z</startTime>
<endedTime xsi:nil="true"/>
<awayTeam>
<id>17</id>
<abbreviation>STL</abbreviation>
</awayTeam>
<homeTeam>
<id>20</id>
<abbreviation>CHI</abbreviation>
</homeTeam>
<venue>
<id>28</id>
<name>United Center</name>
</venue>
<venueAllegiance>HOME</venueAllegiance>
<scheduleStatus>NORMAL</scheduleStatus>
<originalStartTime xsi:nil="true"/>
<delayedOrPostponedReason xsi:nil="true"/>
<playedStatus>COMPLETED</playedStatus>
<attendance xsi:nil="true"/>
<officials/>
<broadcasters/>
<weather xsi:nil="true"/>
</schedule>
<score>
<currentPeriod xsi:nil="true"/>
<currentPeriodSecondsRemaining xsi:nil="true"/>
<currentIntermission xsi:nil="true"/>
<awayScoreTotal>0</awayScoreTotal>
<awayShotsTotal>28</awayShotsTotal>
<homeScoreTotal>1</homeScoreTotal>
<homeShotsTotal>19</homeShotsTotal>
<periods>
<periodNumber>1</periodNumber>
<awayScore>0</awayScore>
<awayShots>8</awayShots>
<homeScore>0</homeScore>
<homeShots>10</homeShots>
</periods>
<periods>
<periodNumber>2</periodNumber>
<awayScore>0</awayScore>
<awayShots>10</awayShots>
<homeScore>1</homeScore>
<homeShots>5</homeShots>
</periods>
<periods>
<periodNumber>3</periodNumber>
<awayScore>0</awayScore>
<awayShots>10</awayShots>
<homeScore>0</homeScore>
<homeShots>4</homeShots>
</periods>
</score>
</games>
<games>
<schedule>
<id>46572</id>
<startTime>2018-11-15T01:00:00.000Z</startTime>
<endedTime xsi:nil="true"/>
<awayTeam>
<id>5</id>
<abbreviation>WSH</abbreviation>
</awayTeam>
<homeTeam>
<id>2</id>
<abbreviation>WPJ</abbreviation>
</homeTeam>
<venue>
<id>39</id>
<name>Bell MTS Place</name>
</venue>
<venueAllegiance>HOME</venueAllegiance>
<scheduleStatus>NORMAL</scheduleStatus>
<originalStartTime xsi:nil="true"/>
<delayedOrPostponedReason xsi:nil="true"/>
<playedStatus>COMPLETED</playedStatus>
<attendance xsi:nil="true"/>
<officials/>
<broadcasters/>
<weather xsi:nil="true"/>
</schedule>
<score>
<currentPeriod xsi:nil="true"/>
<currentPeriodSecondsRemaining xsi:nil="true"/>
<currentIntermission xsi:nil="true"/>
<awayScoreTotal>1</awayScoreTotal>
<awayShotsTotal>28</awayShotsTotal>
<homeScoreTotal>3</homeScoreTotal>
<homeShotsTotal>24</homeShotsTotal>
<periods>
<periodNumber>1</periodNumber>
<awayScore>1</awayScore>
<awayShots>10</awayShots>
<homeScore>0</homeScore>
<homeShots>2</homeShots>
</periods>
<periods>
<periodNumber>2</periodNumber>
<awayScore>0</awayScore>
<awayShots>10</awayShots>
<homeScore>1</homeScore>
<homeShots>14</homeShots>
</periods>
<periods>
<periodNumber>3</periodNumber>
<awayScore>0</awayScore>
<awayShots>8</awayShots>
<homeScore>2</homeScore>
<homeShots>8</homeShots>
</periods>
</score>
</games>
<games>
<schedule>
<id>46573</id>
<startTime>2018-11-15T03:00:00.000Z</startTime>
<endedTime xsi:nil="true"/>
<awayTeam>
<id>11</id>
<abbreviation>BOS</abbreviation>
</awayTeam>
<homeTeam>
<id>22</id>
<abbreviation>COL</abbreviation>
</homeTeam>
<venue>
<id>19</id>
<name>Pepsi Center</name>
</venue>
<venueAllegiance>HOME</venueAllegiance>
<scheduleStatus>NORMAL</scheduleStatus>
<originalStartTime xsi:nil="true"/>
<delayedOrPostponedReason xsi:nil="true"/>
<playedStatus>COMPLETED</playedStatus>
<attendance xsi:nil="true"/>
<officials/>
<broadcasters/>
<weather xsi:nil="true"/>
</schedule>
<score>
<currentPeriod xsi:nil="true"/>
<currentPeriodSecondsRemaining xsi:nil="true"/>
<currentIntermission xsi:nil="true"/>
<awayScoreTotal>3</awayScoreTotal>
<awayShotsTotal>23</awayShotsTotal>
<homeScoreTotal>6</homeScoreTotal>
<homeShotsTotal>25</homeShotsTotal>
<periods>
<periodNumber>1</periodNumber>
<awayScore>2</awayScore>
<awayShots>10</awayShots>
<homeScore>1</homeScore>
<homeShots>7</homeShots>
</periods>
<periods>
<periodNumber>2</periodNumber>
<awayScore>1</awayScore>
<awayShots>4</awayShots>
<homeScore>1</homeScore>
<homeShots>7</homeShots>
</periods>
<periods>
<periodNumber>3</periodNumber>
<awayScore>0</awayScore>
<awayShots>9</awayShots>
<homeScore>4</homeScore>
<homeShots>11</homeShots>
</periods>
</score>
</games>
<games>
<schedule>
<id>46574</id>
<startTime>2018-11-15T03:30:00.000Z</startTime>
<endedTime xsi:nil="true"/>
<awayTeam>
<id>29</id>
<abbreviation>ANA</abbreviation>
</awayTeam>
<homeTeam>
<id>142</id>
<abbreviation>VGK</abbreviation>
</homeTeam>
<venue>
<id>139</id>
<name>T-Mobile Arena</name>
</venue>
<venueAllegiance>HOME</venueAllegiance>
<scheduleStatus>NORMAL</scheduleStatus>
<originalStartTime xsi:nil="true"/>
<delayedOrPostponedReason xsi:nil="true"/>
<playedStatus>COMPLETED</playedStatus>
<attendance xsi:nil="true"/>
<officials/>
<broadcasters/>
<weather xsi:nil="true"/>
</schedule>
<score>
<currentPeriod xsi:nil="true"/>
<currentPeriodSecondsRemaining xsi:nil="true"/>
<currentIntermission xsi:nil="true"/>
<awayScoreTotal>0</awayScoreTotal>
<awayShotsTotal>29</awayShotsTotal>
<homeScoreTotal>5</homeScoreTotal>
<homeShotsTotal>26</homeShotsTotal>
<periods>
<periodNumber>1</periodNumber>
<awayScore>0</awayScore>
<awayShots>6</awayShots>
<homeScore>1</homeScore>
<homeShots>10</homeShots>
</periods>
<periods>
<periodNumber>2</periodNumber>
<awayScore>0</awayScore>
<awayShots>12</awayShots>
<homeScore>3</homeScore>
<homeShots>6</homeShots>
</periods>
<periods>
<periodNumber>3</periodNumber>
<awayScore>0</awayScore>
<awayShots>11</awayShots>
<homeScore>1</homeScore>
<homeShots>10</homeShots>
</periods>
</score>
</games>
<references>
<teamReferences>
<id>2</id>
<city>Winnipeg</city>
<name>Jets</name>
<abbreviation>WPJ</abbreviation>
<homeVenue>
<id>39</id>
<name>Bell MTS Place</name>
</homeVenue>
<teamColoursHex/>
<socialMediaAccounts/>
<officialLogoImageSrc xsi:nil="true"/>
</teamReferences>
<teamReferences>
<id>5</id>
<city>Washington</city>
<name>Capitals</name>
<abbreviation>WSH</abbreviation>
<homeVenue>
<id>13</id>
<name>Capital One Arena</name>
</homeVenue>
<teamColoursHex/>
<socialMediaAccounts/>
<officialLogoImageSrc xsi:nil="true"/>
</teamReferences>
<teamReferences>
<id>11</id>
<city>Boston</city>
<name>Bruins</name>
<abbreviation>BOS</abbreviation>
<homeVenue>
<id>27</id>
<name>TD Garden</name>
</homeVenue>
<teamColoursHex/>
<socialMediaAccounts/>
<officialLogoImageSrc xsi:nil="true"/>
</teamReferences>
<teamReferences>
<id>17</id>
<city>St. Louis</city>
<name>Blues</name>
<abbreviation>STL</abbreviation>
<homeVenue>
<id>24</id>
<name>Enterprise Center</name>
</homeVenue>
<teamColoursHex/>
<socialMediaAccounts/>
<officialLogoImageSrc xsi:nil="true"/>
</teamReferences>
<teamReferences>
<id>20</id>
<city>Chicago</city>
<name>Blackhawks</name>
<abbreviation>CHI</abbreviation>
<homeVenue>
<id>28</id>
<name>United Center</name>
</homeVenue>
<teamColoursHex/>
<socialMediaAccounts/>
<officialLogoImageSrc xsi:nil="true"/>
</teamReferences>
<teamReferences>
<id>22</id>
<city>Colorado</city>
<name>Avalanche</name>
<abbreviation>COL</abbreviation>
<homeVenue>
<id>19</id>
<name>Pepsi Center</name>
</homeVenue>
<teamColoursHex/>
<socialMediaAccounts/>
<officialLogoImageSrc xsi:nil="true"/>
</teamReferences>
<teamReferences>
<id>29</id>
<city>Anaheim</city>
<name>Ducks</name>
<abbreviation>ANA</abbreviation>
<homeVenue>
<id>8</id>
<name>Honda Center</name>
</homeVenue>
<teamColoursHex/>
<socialMediaAccounts/>
<officialLogoImageSrc xsi:nil="true"/>
</teamReferences>
<teamReferences>
<id>142</id>
<city>Vegas</city>
<name>Golden Knights</name>
<abbreviation>VGK</abbreviation>
<homeVenue>
<id>139</id>
<name>T-Mobile Arena</name>
</homeVenue>
<teamColoursHex/>
<socialMediaAccounts/>
<officialLogoImageSrc xsi:nil="true"/>
</teamReferences>
<venueReferences>
<id>19</id>
<name>Pepsi Center</name>
<city>Denver, CO</city>
<country>USA</country>
<geoCoordinates xsi:nil="true"/>
<capacitiesByEventType/>
<playingSurface xsi:nil="true"/>
<baseballDimensions/>
<hasRoof xsi:nil="true"/>
<hasRetractableRoof xsi:nil="true"/>
</venueReferences>
<venueReferences>
<id>28</id>
<name>United Center</name>
<city>Chicago, IL</city>
<country>USA</country>
<geoCoordinates xsi:nil="true"/>
<capacitiesByEventType/>
<playingSurface xsi:nil="true"/>
<baseballDimensions/>
<hasRoof xsi:nil="true"/>
<hasRetractableRoof xsi:nil="true"/>
</venueReferences>
<venueReferences>
<id>39</id>
<name>Bell MTS Place</name>
<city>Winnipeg, MB</city>
<country>Canada</country>
<geoCoordinates xsi:nil="true"/>
<capacitiesByEventType/>
<playingSurface xsi:nil="true"/>
<baseballDimensions/>
<hasRoof xsi:nil="true"/>
<hasRetractableRoof xsi:nil="true"/>
</venueReferences>
<venueReferences>
<id>139</id>
<name>T-Mobile Arena</name>
<city>Paradise, NV</city>
<country>USA</country>
<geoCoordinates xsi:nil="true"/>
<capacitiesByEventType/>
<playingSurface xsi:nil="true"/>
<baseballDimensions/>
<hasRoof xsi:nil="true"/>
<hasRetractableRoof xsi:nil="true"/>
</venueReferences>
</references>
</gam:iceHockeyGames>
Here is my full .ini. As this particular date had 4 games, I'm only putting in 4 but I'll need up to 15 apparently. Side note; is there a way to condense this?

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=
Author=
Information=
Version=
License=

[Variables]
HomeTeam=(?(?=.*<homeTeam>).*<abbreviation>(.*)</abbreviation>)
AwayScore=(?(?=.*<score>).*<awayScoreTotal>(.*)</awayScoreTotal>)
AwayTeam=(?(?=.*<awayTeam>).*<abbreviation>(.*)</abbreviation>)
HomeScore=(?(?=.*<score>).*<homeScoreTotal>(.*)</homeScoreTotal>)

[MeasureNHL] 
Measure=Plugin 
Plugin=WebParser 
Header=Authorization: REDACTED
URL=REDACTED
RegExp=(?siU)#AwayTeam##HomeTeam##AwayScore##HomeScore##AwayTeam##HomeTeam##AwayScore##HomeScore##AwayTeam##HomeTeam##AwayScore##HomeScore##AwayTeam##HomeTeam##AwayScore##HomeScore#


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 1;;;;;;;;;;;;;;;;;;
[MeasureGame1AwayTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=1

[MeterGame1AwayTeam]
Meter=String
MeasureName=MeasureGame1AwayTeam
x=30
y=25
w=500
h=100
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame1HomeTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=2

[MeterGame1HomeTeam]
Meter=String
MeasureName=MeasureGame1HomeTeam
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame1AwayScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=3

[MeterGame1AwayScore]
Meter=String
MeasureName=MeasureGame1AwayScore
x=75r
y=25
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame1HomeScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=4

[MeterGame1HomeScore]
Meter=String
MeasureName=MeasureGame1HomeScore
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 2;;;;;;;;;;;;;;;;;;
[MeasureGame2AwayTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=5

[MeterGame2AwayTeam]
Meter=String
MeasureName=MeasureGame2AwayTeam
x=30
y=100
w=75
h=25
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame2HomeTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=6

[MeterGame2HomeTeam]
Meter=String
MeasureName=MeasureGame2HomeTeam
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame2AwayScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=7

[MeterGame2AwayScore]
Meter=String
MeasureName=MeasureGame2AwayScore
x=75r
y=100
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame2HomeScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=8

[MeterGame2HomeScore]
Meter=String
MeasureName=MeasureGame2HomeScore
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 3;;;;;;;;;;;;;;;;;;
[MeasureGame3AwayTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=9

[MeterGame3AwayTeam]
Meter=String
MeasureName=MeasureGame3AwayTeam
x=30
y=175
w=100
h=25
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame3HomeTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=10

[MeterGame3HomeTeam]
Meter=String
MeasureName=MeasureGame3HomeTeam
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame3AwayScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=11

[MeterGame3AwayScore]
Meter=String
MeasureName=MeasureGame3AwayScore
x=75r
y=175
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame3HomeScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=12

[MeterGame3HomeScore]
Meter=String
MeasureName=MeasureGame3HomeScore
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 4;;;;;;;;;;;;;;;;;;
[MeasureGame4AwayTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=13

[MeterGame4AwayTeam]
Meter=String
MeasureName=MeasureGame4AwayTeam
x=30
y=250
w=100
h=25
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame4HomeTeam]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=14

[MeterGame4HomeTeam]
Meter=String
MeasureName=MeasureGame4HomeTeam
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame4AwayScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=15

[MeterGame4AwayScore]
Meter=String
MeasureName=MeasureGame4AwayScore
x=75r
y=250
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame4HomeScore]
Measure=Plugin
Plugin=WebParser
URL=[MeasureNHL]
StringIndex=16

[MeterGame4HomeScore]
Meter=String
MeasureName=MeasureGame4HomeScore
x=r
y=25r
w=r
h=r
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1
There are 16 variables in the RegExp and 16 meters referencing 16 measures but if I comment out the last one I don't get the error. Is there maybe a max of only 15? I haven't seen that said anywhere. It also doesn't explain why I'm missing the 4HomeScore which is #16th AND 4HomeTeam which is #14th but 4AwayScore shows up which is StringIndex #15.

Edited to add image:
Image

Edit Edit:
I changed the H= value and now the last team shows up but the last score is still throwing a "Not enough substrings" error.
User avatar
balala
Rainmeter Sage
Posts: 7191
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Unexpected/Missing results using lookahead

balala » November 25th, 2018, 1:56 pm

Tical84 wrote:
November 25th, 2018, 12:39 am
I changed the H= value and now the last team shows up but the last score is still throwing a "Not enough substrings" error.
Replace the HomeTeam, AwayScore, AwayTeam and HomeScore variables (within the [Variables] section) with the following Score and Team:

Code: Select all

[Variables]
;HomeTeam=(?(?=.*<homeTeam>).*<abbreviation>(.*)</abbreviation>)
;AwayScore=(?(?=.*<score>).*<awayScoreTotal>(.*)</awayScoreTotal>)
;AwayTeam=(?(?=.*<awayTeam>).*<abbreviation>(.*)</abbreviation>)
;HomeScore=(?(?=.*<score>).*<homeScoreTotal>(.*)</homeScoreTotal>)
Score=(?(?=.*<score>).*<awayScoreTotal>(.*)</awayScoreTotal>.*<homeScoreTotal>(.*)</homeScoreTotal>)
Team=(?(?=.*<awayTeam>).*<abbreviation>(.*)</abbreviation>)(?(?=.*<homeTeam>).*<abbreviation>(.*)</abbreviation>)
(for now I just commented out the previously used variables, didn't remove them completely).
Then replace the RegExp option of the [MeasureNHL] measure with the following one: RegExp=(?siU)#Team##Score##Team##Score##Team##Score##Team##Score#.
Further tips:
  • Although it works, recently WebParser became a measure, it's not a plugin any more. You should have to replace all occurrences of the following options:

    Code: Select all

    Measure=Plugin 
    Plugin=WebParser 
    with the much more simpler Measure=WebParser.
  • I think you made a confusion: the r parameter, used into the X and Y options of meters, can't be used into the W and H options as well. You've used such sizes more times, for example in [MeterGame1HomeTeam], [MeterGame1AwayScore] or [MeterGame1HomeScore] (but in many other too).
  • To make the skin much more easier clickable, I'd add the following two options to the [Rainmeter] section of my skin:

    Code: Select all

    [Rainmeter]
    ...
    BackgroundMode=2
    SolidColor=0,0,0,1
    These options add a practically transparent background to the skin, which this way become clickable. If you don't have a background (or have a transparent background), you have to click (right click) exactly to the shown letters to make the skin to react.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3053
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Unexpected/Missing results using lookahead

eclectic-tech » November 25th, 2018, 2:33 pm

balala beat me to the answer... :p

To explain why you were getting the "Not enough substrings" error message.
You were using lookahead to find "scores", then only capturing 1 string.
Then when you used lookahead again for "scores", there are no more "scores" further in the file for the lookahead to find (you are already at the last game), so the last capture never happens.

What balala does (and I was suggesting) is to capture both team abbreviations when the teams lookahead succeeds, and capture both scores when the scores lookahead succeeds. That eliminates the missing substring error caused by the duplicate "scores" lookahead.

As balala mentioned, width and height do not support "relative" sizing...
Replace every 'w=r' with 'w=75' and 'h=r' with 'h=100' to correct meter sizes.

Nice skin by the way! :thumbup:
Tical84
Posts: 14
Joined: November 24th, 2018, 9:34 pm

Re: Unexpected/Missing results using lookahead

Tical84 » November 25th, 2018, 5:05 pm

Yes! Thank you both for not only the answer, but also the explanation. The r in W and H I had fixed late last night after some more reading but the last score was still eluding me.

balala, you also helped me by helping someone else on an older thread I dug up about replacing strings with images and now I have the team logo in place of the text.
eclectic-tech wrote:Nice skin by the way! :thumbup:
Thank you. I've been using Rainmeter for a few years now but haven't tried to make my own until recently.
User avatar
balala
Rainmeter Sage
Posts: 7191
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Unexpected/Missing results using lookahead

balala » November 25th, 2018, 5:13 pm

Tical84 wrote:
November 25th, 2018, 5:05 pm
balala, you also helped me by helping someone else on an older thread I dug up about replacing strings with images and now I have the team logo in place of the text.
Glad if we helped. In fact, I'm glad every time I can help. :thumbup:
Tical84 wrote:
November 25th, 2018, 5:05 pm
I've been using Rainmeter for a few years now but haven't tried to make my own until recently.
Keep working. It's great! Rainmeter is extraordinary. :great:
Tical84
Posts: 14
Joined: November 24th, 2018, 9:34 pm

Re: Unexpected/Missing results using lookahead

Tical84 » November 29th, 2018, 12:43 am

Gah, sorry guys I need your help again and I'm posting it here because it's actually related.

Short version of the story is I needed to change the URL I was using and now it's laid out different. I modified the variable to match what I thought you explained but when I get to the last team, this time the log says (in today's case);
21,
"name" : "Colorado Avalanche",
"link" : "/api/v1/teams/21"
}
}
},
"linescore" : {
"currentPeriod" : 0,
"periods" : [ ],
"shootoutInfo" : {
"away" : {
"scores" : 0,
"attempts" : 0
},
"home" : {
"scores" : 0,
"attempts" : 0
}
},
It's supposed to only grab the "21" and stop, and it does that for every other team, but the last one it doesn't. I should mention that this also ONLY happens when I have more variables than games. For example today there are 5 games but I need enough variables for 15 as there can be up to 15 games/day. If I only have 5, it works fine. 6 or more I get this.

New URL (json maybe?)

Code: Select all

{
  "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.",
  "totalItems" : 5,
  "totalEvents" : 0,
  "totalGames" : 5,
  "totalMatches" : 0,
  "wait" : 10,
  "dates" : [ {
    "date" : "2018-11-28",
    "totalItems" : 5,
    "totalEvents" : 0,
    "totalGames" : 5,
    "totalMatches" : 0,
    "games" : [ {
      "gamePk" : 2018020377,
      "link" : "/api/v1/game/2018020377/feed/live",
      "gameType" : "R",
      "season" : "20182019",
      "gameDate" : "2018-11-29T00:00:00Z",
      "status" : {
        "abstractGameState" : "Live",
        "codedGameState" : "3",
        "detailedState" : "In Progress",
        "statusCode" : "3",
        "startTimeTBD" : false
      },
      "teams" : {
        "away" : {
          "leagueRecord" : {
            "wins" : 8,
            "losses" : 11,
            "ot" : 3,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 19,
            "name" : "St. Louis Blues",
            "link" : "/api/v1/teams/19"
          }
        },
        "home" : {
          "leagueRecord" : {
            "wins" : 10,
            "losses" : 11,
            "ot" : 3,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 17,
            "name" : "Detroit Red Wings",
            "link" : "/api/v1/teams/17"
          }
        }
      },
      "linescore" : {
        "currentPeriod" : 1,
        "currentPeriodOrdinal" : "1st",
        "currentPeriodTimeRemaining" : "09:42",
        "periods" : [ {
          "periodType" : "REGULAR",
          "startTime" : "2018-11-29T00:10:18Z",
          "num" : 1,
          "ordinalNum" : "1st",
          "home" : {
            "goals" : 0,
            "shotsOnGoal" : 9,
            "rinkSide" : "right"
          },
          "away" : {
            "goals" : 0,
            "shotsOnGoal" : 4,
            "rinkSide" : "left"
          }
        } ],
        "shootoutInfo" : {
          "away" : {
            "scores" : 0,
            "attempts" : 0
          },
          "home" : {
            "scores" : 0,
            "attempts" : 0
          }
        },
        "teams" : {
          "home" : {
            "team" : {
              "id" : 17,
              "name" : "Detroit Red Wings",
              "link" : "/api/v1/teams/17"
            },
            "goals" : 0,
            "shotsOnGoal" : 9,
            "goaliePulled" : false,
            "numSkaters" : 5,
            "powerPlay" : true
          },
          "away" : {
            "team" : {
              "id" : 19,
              "name" : "St. Louis Blues",
              "link" : "/api/v1/teams/19"
            },
            "goals" : 0,
            "shotsOnGoal" : 4,
            "goaliePulled" : false,
            "numSkaters" : 4,
            "powerPlay" : false
          }
        },
        "powerPlayStrength" : "5-on-4",
        "hasShootout" : false,
        "intermissionInfo" : {
          "intermissionTimeRemaining" : 0,
          "intermissionTimeElapsed" : 0,
          "inIntermission" : false
        },
        "powerPlayInfo" : {
          "situationTimeRemaining" : 120,
          "situationTimeElapsed" : 0,
          "inSituation" : true
        }
      },
      "venue" : {
        "id" : 5145,
        "name" : "Little Caesars Arena",
        "link" : "/api/v1/venues/5145"
      },
      "content" : {
        "link" : "/api/v1/game/2018020377/content"
      }
    }, {
      "gamePk" : 2018020378,
      "link" : "/api/v1/game/2018020378/feed/live",
      "gameType" : "R",
      "season" : "20182019",
      "gameDate" : "2018-11-29T00:00:00Z",
      "status" : {
        "abstractGameState" : "Live",
        "codedGameState" : "3",
        "detailedState" : "In Progress",
        "statusCode" : "3",
        "startTimeTBD" : false
      },
      "teams" : {
        "away" : {
          "leagueRecord" : {
            "wins" : 11,
            "losses" : 10,
            "ot" : 5,
            "type" : "league"
          },
          "score" : 1,
          "team" : {
            "id" : 24,
            "name" : "Anaheim Ducks",
            "link" : "/api/v1/teams/24"
          }
        },
        "home" : {
          "leagueRecord" : {
            "wins" : 9,
            "losses" : 9,
            "ot" : 4,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 13,
            "name" : "Florida Panthers",
            "link" : "/api/v1/teams/13"
          }
        }
      },
      "linescore" : {
        "currentPeriod" : 1,
        "currentPeriodOrdinal" : "1st",
        "currentPeriodTimeRemaining" : "08:31",
        "periods" : [ {
          "periodType" : "REGULAR",
          "startTime" : "2018-11-29T00:09:08Z",
          "num" : 1,
          "ordinalNum" : "1st",
          "home" : {
            "goals" : 0,
            "shotsOnGoal" : 8,
            "rinkSide" : "right"
          },
          "away" : {
            "goals" : 1,
            "shotsOnGoal" : 7,
            "rinkSide" : "left"
          }
        } ],
        "shootoutInfo" : {
          "away" : {
            "scores" : 0,
            "attempts" : 0
          },
          "home" : {
            "scores" : 0,
            "attempts" : 0
          }
        },
        "teams" : {
          "home" : {
            "team" : {
              "id" : 13,
              "name" : "Florida Panthers",
              "link" : "/api/v1/teams/13"
            },
            "goals" : 0,
            "shotsOnGoal" : 8,
            "goaliePulled" : false,
            "numSkaters" : 5,
            "powerPlay" : false
          },
          "away" : {
            "team" : {
              "id" : 24,
              "name" : "Anaheim Ducks",
              "link" : "/api/v1/teams/24"
            },
            "goals" : 1,
            "shotsOnGoal" : 7,
            "goaliePulled" : false,
            "numSkaters" : 5,
            "powerPlay" : false
          }
        },
        "powerPlayStrength" : "Even",
        "hasShootout" : false,
        "intermissionInfo" : {
          "intermissionTimeRemaining" : 0,
          "intermissionTimeElapsed" : 0,
          "inIntermission" : false
        },
        "powerPlayInfo" : {
          "situationTimeRemaining" : 511,
          "situationTimeElapsed" : 59,
          "inSituation" : false
        }
      },
      "venue" : {
        "id" : 5027,
        "name" : "BB&T Center",
        "link" : "/api/v1/venues/5027"
      },
      "content" : {
        "link" : "/api/v1/game/2018020378/content"
      }
    }, {
      "gamePk" : 2018020379,
      "link" : "/api/v1/game/2018020379/feed/live",
      "gameType" : "R",
      "season" : "20182019",
      "gameDate" : "2018-11-29T00:30:00Z",
      "status" : {
        "abstractGameState" : "Preview",
        "codedGameState" : "2",
        "detailedState" : "Pre-Game",
        "statusCode" : "2",
        "startTimeTBD" : false
      },
      "teams" : {
        "away" : {
          "leagueRecord" : {
            "wins" : 12,
            "losses" : 8,
            "ot" : 5,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 28,
            "name" : "San Jose Sharks",
            "link" : "/api/v1/teams/28"
          }
        },
        "home" : {
          "leagueRecord" : {
            "wins" : 17,
            "losses" : 8,
            "ot" : 0,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 10,
            "name" : "Toronto Maple Leafs",
            "link" : "/api/v1/teams/10"
          }
        }
      },
      "linescore" : {
        "currentPeriod" : 0,
        "periods" : [ ],
        "shootoutInfo" : {
          "away" : {
            "scores" : 0,
            "attempts" : 0
          },
          "home" : {
            "scores" : 0,
            "attempts" : 0
          }
        },
        "teams" : {
          "home" : {
            "team" : {
              "id" : 10,
              "name" : "Toronto Maple Leafs",
              "link" : "/api/v1/teams/10"
            },
            "goals" : 0,
            "shotsOnGoal" : 0,
            "goaliePulled" : false,
            "numSkaters" : 0,
            "powerPlay" : false
          },
          "away" : {
            "team" : {
              "id" : 28,
              "name" : "San Jose Sharks",
              "link" : "/api/v1/teams/28"
            },
            "goals" : 0,
            "shotsOnGoal" : 0,
            "goaliePulled" : false,
            "numSkaters" : 0,
            "powerPlay" : false
          }
        },
        "powerPlayStrength" : "Even",
        "hasShootout" : false,
        "intermissionInfo" : {
          "intermissionTimeRemaining" : 0,
          "intermissionTimeElapsed" : 0,
          "inIntermission" : false
        }
      },
      "venue" : {
        "name" : "Scotiabank Arena",
        "link" : "/api/v1/venues/null"
      },
      "content" : {
        "link" : "/api/v1/game/2018020379/content"
      }
    }, {
      "gamePk" : 2018020380,
      "link" : "/api/v1/game/2018020380/feed/live",
      "gameType" : "R",
      "season" : "20182019",
      "gameDate" : "2018-11-29T02:00:00Z",
      "status" : {
        "abstractGameState" : "Preview",
        "codedGameState" : "1",
        "detailedState" : "Scheduled",
        "statusCode" : "1",
        "startTimeTBD" : false
      },
      "teams" : {
        "away" : {
          "leagueRecord" : {
            "wins" : 12,
            "losses" : 10,
            "ot" : 3,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 25,
            "name" : "Dallas Stars",
            "link" : "/api/v1/teams/25"
          }
        },
        "home" : {
          "leagueRecord" : {
            "wins" : 14,
            "losses" : 9,
            "ot" : 1,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 20,
            "name" : "Calgary Flames",
            "link" : "/api/v1/teams/20"
          }
        }
      },
      "linescore" : {
        "currentPeriod" : 0,
        "periods" : [ ],
        "shootoutInfo" : {
          "away" : {
            "scores" : 0,
            "attempts" : 0
          },
          "home" : {
            "scores" : 0,
            "attempts" : 0
          }
        },
        "teams" : {
          "home" : {
            "team" : {
              "id" : 20,
              "name" : "Calgary Flames",
              "link" : "/api/v1/teams/20"
            },
            "goals" : 0,
            "shotsOnGoal" : 0,
            "goaliePulled" : false,
            "numSkaters" : 0,
            "powerPlay" : false
          },
          "away" : {
            "team" : {
              "id" : 25,
              "name" : "Dallas Stars",
              "link" : "/api/v1/teams/25"
            },
            "goals" : 0,
            "shotsOnGoal" : 0,
            "goaliePulled" : false,
            "numSkaters" : 0,
            "powerPlay" : false
          }
        },
        "powerPlayStrength" : "Even",
        "hasShootout" : false,
        "intermissionInfo" : {
          "intermissionTimeRemaining" : 0,
          "intermissionTimeElapsed" : 0,
          "inIntermission" : false
        }
      },
      "venue" : {
        "id" : 5075,
        "name" : "Scotiabank Saddledome",
        "link" : "/api/v1/venues/5075"
      },
      "content" : {
        "link" : "/api/v1/game/2018020380/content"
      }
    }, {
      "gamePk" : 2018020381,
      "link" : "/api/v1/game/2018020381/feed/live",
      "gameType" : "R",
      "season" : "20182019",
      "gameDate" : "2018-11-29T02:30:00Z",
      "status" : {
        "abstractGameState" : "Preview",
        "codedGameState" : "1",
        "detailedState" : "Scheduled",
        "statusCode" : "1",
        "startTimeTBD" : false
      },
      "teams" : {
        "away" : {
          "leagueRecord" : {
            "wins" : 10,
            "losses" : 8,
            "ot" : 5,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 5,
            "name" : "Pittsburgh Penguins",
            "link" : "/api/v1/teams/5"
          }
        },
        "home" : {
          "leagueRecord" : {
            "wins" : 14,
            "losses" : 6,
            "ot" : 4,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 21,
            "name" : "Colorado Avalanche",
            "link" : "/api/v1/teams/21"
          }
        }
      },
      "linescore" : {
        "currentPeriod" : 0,
        "periods" : [ ],
        "shootoutInfo" : {
          "away" : {
            "scores" : 0,
            "attempts" : 0
          },
          "home" : {
            "scores" : 0,
            "attempts" : 0
          }
        },
        "teams" : {
          "home" : {
            "team" : {
              "id" : 21,
              "name" : "Colorado Avalanche",
              "link" : "/api/v1/teams/21"
            },
            "goals" : 0,
            "shotsOnGoal" : 0,
            "goaliePulled" : false,
            "numSkaters" : 0,
            "powerPlay" : false
          },
          "away" : {
            "team" : {
              "id" : 5,
              "name" : "Pittsburgh Penguins",
              "link" : "/api/v1/teams/5"
            },
            "goals" : 0,
            "shotsOnGoal" : 0,
            "goaliePulled" : false,
            "numSkaters" : 0,
            "powerPlay" : false
          }
        },
        "powerPlayStrength" : "Even",
        "hasShootout" : false,
        "intermissionInfo" : {
          "intermissionTimeRemaining" : 0,
          "intermissionTimeElapsed" : 0,
          "inIntermission" : false
        }
      },
      "venue" : {
        "id" : 5064,
        "name" : "Pepsi Center",
        "link" : "/api/v1/venues/5064"
      },
      "content" : {
        "link" : "/api/v1/game/2018020381/content"
      }
    } ],
    "events" : [ ],
    "matches" : [ ]
  } ]
}
ini:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,1


[Metadata]
Name=
Author=
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0


[Variables]
Away=(?(?=.*"teams").*"score" : (.*),.*"id" : (.*),.*"score" : (.*),.*"id" : (.*),)
;Home=(?(?=.*"teams").*"score" : (.*),.*"id" : (.*),)

;Score=(?(?=.*<score>).*<awayScoreTotal>(.*)</awayScoreTotal>.*<homeScoreTotal>(.*)</homeScoreTotal>)
[MeasureNHL] 
Measure=WebParser 
URL=https://statsapi.web.nhl.com/api/v1/schedule?expand=schedule.linescore
RegExp=(?siU)#Away##Away##Away##Away##Away##Away##Away##Away##Away##Away#
;#Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home##Away##Home#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 1;;;;;;;;;;;;;;;;;;
[MeasureGame1AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=1

[MeterGame1AwayScore]
Meter=String
MeasureName=MeasureGame1AwayScore
x=325
y=25
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame1HomeScore]
Measure=WebParser
URL=[MeasureNHL]
StringIndex=3

[MeterGame1HomeScore]
Meter=String
MeasureName=MeasureGame1HomeScore
x=r
y=40r
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame1AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=2


[MeterGame1AwayTeam]
Meter=Image
MeasureName=MeasureGame1AwayTeam
x=250
y=25
w=40
h=40

[MeasureGame1HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=4

[MeterGame1HomeTeam]
Meter=Image
MeasureName=MeasureGame1HomeTeam
x=r
y=40r
w=40
h=40
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 2;;;;;;;;;;;;;;;;;;
[MeasureGame2AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=5

[MeterGame2AwayScore]
Meter=String
MeasureName=MeasureGame2AwayScore
x=325
y=125
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame2HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=7

[MeterGame2HomeScore]
Meter=String
MeasureName=MeasureGame2HomeScore
x=r
y=40r
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame2AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=6

[MeterGame2AwayTeam]
Meter=Image
MeasureName=MeasureGame2AwayTeam
x=250
y=125
w=40
h=40

[MeasureGame2HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=8

[MeterGame2HomeTeam]
Meter=Image
MeasureName=MeasureGame2HomeTeam
x=r
y=40r
w=40
h=40
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 3;;;;;;;;;;;;;;;;;;
[MeasureGame3AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=9

[MeterGame3AwayScore]
Meter=String
MeasureName=MeasureGame3AwayScore
x=325
y=225
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame3HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=11

[MeterGame3HomeScore]
Meter=String
MeasureName=MeasureGame3HomeScore
x=r
y=40r
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame3AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=10

[MeterGame3AwayTeam]
Meter=Image
MeasureName=MeasureGame3AwayTeam
x=250
y=225
w=40
h=40

[MeasureGame3HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=12

[MeterGame3HomeTeam]
Meter=Image
MeasureName=MeasureGame3HomeTeam
x=r
y=40r
w=40
h=40

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 4;;;;;;;;;;;;;;;;;;
[MeasureGame4AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=13

[MeterGame4AwayScore]
Meter=String
MeasureName=MeasureGame4AwayScore
x=325
y=325
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame4HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=15

[MeterGame4HomeScore]
Meter=String
MeasureName=MeasureGame4HomeScore
x=r
y=40r
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame4AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=14

[MeterGame4AwayTeam]
Meter=Image
MeasureName=MeasureGame4AwayTeam
x=250
y=325
w=40
h=40

[MeasureGame4HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=16

[MeterGame4HomeTeam]
Meter=Image
MeasureName=MeasureGame4HomeTeam
x=r
y=40r
w=40
h=40

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 5;;;;;;;;;;;;;;;;;;
[MeasureGame5AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=17

[MeterGame5AwayScore]
Meter=String
MeasureName=MeasureGame5AwayScore
x=325
y=425
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame5HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=19

[MeterGame5HomeScore]
Meter=String
MeasureName=MeasureGame5HomeScore
x=r
y=40r
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame5AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=18

[MeterGame5AwayTeam]
Meter=Image
MeasureName=MeasureGame5AwayTeam
x=250
y=425
w=40
h=40


[MeasureGame5HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=20

[MeterGame5HomeTeam]
Meter=Image
MeasureName=MeasureGame5HomeTeam
x=r
y=40r
w=40
h=40

;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 6;;;;;;;;;;;;;;;;;;
[MeasureGame6AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=21

[MeterGame6AwayScore]
Meter=String
MeasureName=MeasureGame6AwayScore
x=325
y=525
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame6HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=23

[MeterGame6HomeScore]
Meter=String
MeasureName=MeasureGame6HomeScore
x=r
y=40r
w=25
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame6AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=22

[MeterGame6AwayTeam]
Meter=Image
MeasureName=MeasureGame6AwayTeam
x=250
y=525
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame6HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=24

[MeterGame6HomeTeam]
Meter=Image
MeasureName=MeasureGame6HomeTeam
x=r
y=40r
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 7;;;;;;;;;;;;;;;;;;
[MeasureGame7AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=25

[MeterGame7AwayScore]
Meter=String
MeasureName=MeasureGame7AwayScore
x=325
y=625
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame7HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=27

[MeterGame7HomeScore]
Meter=String
MeasureName=MeasureGame7HomeScore
x=r
y=40r
w=25
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame7AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=26

[MeterGame7AwayTeam]
Meter=Image
MeasureName=MeasureGame7AwayTeam
x=250
y=625
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame7HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=28

[MeterGame7HomeTeam]
Meter=Image
MeasureName=MeasureGame7HomeTeam
x=r
y=40r
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 8;;;;;;;;;;;;;;;;;;
[MeasureGame8AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=29

[MeterGame8AwayScore]
Meter=String
MeasureName=MeasureGame8AwayScore
x=325
y=725
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame8HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=31

[MeterGame8HomeScore]
Meter=String
MeasureName=MeasureGame8HomeScore
x=r
y=40r
w=25
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame8AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=30

[MeterGame8AwayTeam]
Meter=Image
MeasureName=MeasureGame8AwayTeam
x=250
y=725
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame8HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=32

[MeterGame8HomeTeam]
Meter=Image
MeasureName=MeasureGame8HomeTeam
x=r
y=40r
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 9;;;;;;;;;;;;;;;;;;
[MeasureGame9AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=33

[MeterGame9AwayScore]
Meter=String
MeasureName=MeasureGame9AwayScore
x=325
y=825
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame9HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=35

[MeterGame9HomeScore]
Meter=String
MeasureName=MeasureGame9HomeScore
x=r
y=40r
w=25
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame9AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=34

[MeterGame9AwayTeam]
Meter=Image
MeasureName=MeasureGame9AwayTeam
x=250
y=825
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame9HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=36

[MeterGame9HomeTeam]
Meter=Image
MeasureName=MeasureGame9HomeTeam
x=r
y=40r
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 10;;;;;;;;;;;;;;;;;;
[MeasureGame10AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=37

[MeterGame10AwayScore]
Meter=String
MeasureName=MeasureGame10AwayScore
x=325
y=925
w=500
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame10HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=39

[MeterGame10HomeScore]
Meter=String
MeasureName=MeasureGame10HomeScore
x=r
y=40r
w=25
h=25
FontSize=25
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame10AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=38

[MeterGame10AwayTeam]
Meter=Image
MeasureName=MeasureGame10AwayTeam
x=250
y=925
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1

[MeasureGame10HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=40

[MeterGame10HomeTeam]
Meter=Image
MeasureName=MeasureGame10HomeTeam
x=r
y=40r
w=40
h=40
FontSize=20
FontColor=255,255,255,255
StringAlign=Right
antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 11;;;;;;;;;;;;;;;;;;
[MeasureGame11AwayTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=41

[MeterGame11AwayTeam]
Meter=String
MeasureName=MeasureGame11AwayTeam
x=325
y=1025
w=25
h=25
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame11HomeTeam]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=42

[MeterGame11HomeTeam]
Meter=String
MeasureName=MeasureGame11HomeTeam
x=r
y=25r
w=25
h=25
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame11AwayScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=43

[MeterGame11AwayScore]
Meter=String
MeasureName=MeasureGame11AwayScore
x=75r
y=1025
w=25
h=25
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1

[MeasureGame11HomeScore]
Measure=WebParser 
URL=[MeasureNHL]
StringIndex=44

[MeterGame11HomeScore]
Meter=String
MeasureName=MeasureGame11HomeScore
x=r
y=25r
w=25
h=25
FontSize=20
FontColor=255,255,255,255
StringAlign=Center
antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 12;;;;;;;;;;;;;;;;;;
; [MeasureGame12AwayTeam]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=45

; [MeterGame12AwayTeam]
; Meter=String
; MeasureName=MeasureGame12AwayTeam
; x=325
; y=1125
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame12HomeTeam]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=46

; [MeterGame12HomeTeam]
; Meter=String
; MeasureName=MeasureGame12HomeTeam
; x=r
; y=25r
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame12AwayScore]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=47

; [MeterGame12AwayScore]
; Meter=String
; MeasureName=MeasureGame12AwayScore
; x=75r
; y=1125
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame12HomeScore]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=48

; [MeterGame12HomeScore]
; Meter=String
; MeasureName=MeasureGame12HomeScore
; x=r
; y=25r
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 13;;;;;;;;;;;;;;;;;;
; [MeasureGame13AwayTeam]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=49

; [MeterGame13AwayTeam]
; Meter=String
; MeasureName=MeasureGame13AwayTeam
; x=325
; y=1225
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame13HomeTeam]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=50

; [MeterGame13HomeTeam]
; Meter=String
; MeasureName=MeasureGame13HomeTeam
; x=r
; y=25r
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame13AwayScore]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=51

; [MeterGame13AwayScore]
; Meter=String
; MeasureName=MeasureGame13AwayScore
; x=75r
; y=1225
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame13HomeScore]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=52

; [MeterGame13HomeScore]
; Meter=String
; MeasureName=MeasureGame13HomeScore
; x=r
; y=25r
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 14;;;;;;;;;;;;;;;;;;
; [MeasureGame14AwayTeam]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=53

; [MeterGame14AwayTeam]
; Meter=String
; MeasureName=MeasureGame14AwayTeam
; x=325
; y=1325
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame14HomeTeam]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=54

; [MeterGame14HomeTeam]
; Meter=String
; MeasureName=MeasureGame14HomeTeam
; x=r
; y=25r
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame14AwayScore]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=55

; [MeterGame14AwayScore]
; Meter=String
; MeasureName=MeasureGame14AwayScore
; x=75r
; y=1325
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame14HomeScore]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=56

; [MeterGame14HomeScore]
; Meter=String
; MeasureName=MeasureGame14HomeScore
; x=r
; y=25r
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1
;;;;;;;;;;;;;;;;;;;;;;;;;;;GAME 15;;;;;;;;;;;;;;;;;;
; [MeasureGame15AwayTeam]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=57

; [MeterGame15AwayTeam]
; Meter=String
; MeasureName=MeasureGame15AwayTeam
; x=325
; y=1425
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame15HomeTeam]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=58

; [MeterGame15HomeTeam]
; Meter=String
; MeasureName=MeasureGame15HomeTeam
; x=r
; y=25r
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame15AwayScore]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=59

; [MeterGame15AwayScore]
; Meter=String
; MeasureName=MeasureGame15AwayScore
; x=75r
; y=1425
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1

; [MeasureGame15HomeScore]
; Measure=WebParser 
; URL=[MeasureNHL]
; StringIndex=60

; [MeterGame15HomeScore]
; Meter=String
; MeasureName=MeasureGame15HomeScore
; x=r
; y=25r
; w=25
; h=25
; FontSize=20
; FontColor=255,255,255,255
; StringAlign=Center
; antialias=1
You can tell I was playing around with a couple variable options but haven't found the right combination yet so ignore that mess. I think my problem is I don't know exactly what I should tell it to look for. Since "teams" shows up twice for each game but doesn't grab it twice like I thought it should (even though I don't want it to), then the last game it grabs a bunch more than I ask it to.

"teams" shows this info:

Code: Select all

      "teams" : {
        "away" : {
          "leagueRecord" : {
            "wins" : 8,
            "losses" : 11,
            "ot" : 3,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 19,
            "name" : "St. Louis Blues",
            "link" : "/api/v1/teams/19"
          }
        },
        "home" : {
          "leagueRecord" : {
            "wins" : 10,
            "losses" : 11,
            "ot" : 3,
            "type" : "league"
          },
          "score" : 0,
          "team" : {
            "id" : 17,
            "name" : "Detroit Red Wings",
            "link" : "/api/v1/teams/17"
          }
        }
      },
But also this right after it for the same game

Code: Select all

        "teams" : {
          "home" : {
            "team" : {
              "id" : 17,
              "name" : "Detroit Red Wings",
              "link" : "/api/v1/teams/17"
            },
            "goals" : 0,
            "shotsOnGoal" : 0,
            "goaliePulled" : false,
            "numSkaters" : 0,
            "powerPlay" : false
          },
          "away" : {
            "team" : {
              "id" : 19,
              "name" : "St. Louis Blues",
              "link" : "/api/v1/teams/19"
            },
            "goals" : 0,
            "shotsOnGoal" : 0,
            "goaliePulled" : false,
            "numSkaters" : 0,
            "powerPlay" : false
          }
        },

Also as a side note, if I take out the "?expand=schedule.linescore" from the URL it works fine, but I want to keep that in there as that's how I'll eventually grab the period, shots, and whatever else I feel like adding.

Thanks in advance.