It is currently September 7th, 2024, 11:50 pm

Mlb Live Scores

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22715
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Mlb Live Scores

Post by jsmorley »

balala wrote:Ok, thanks, that's due of the daylight saving, I think.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
BackgroundMode=2
SolidColor=20,30,40,255
SolidColor2=30,40,50,255
AccurateText=1

[Metadata]
Name=TimeZone
Author=JSMorley
Information=Demonstration of the new Time Zone / Daylight Saving Time functionality in Rainmeter 3.2.0 r2360.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Feb 8, 2015

; Measures

[MeasureNow]
Measure=Time
Format=%A, %B %#d, %Y at %#I:%M:%S %p

[MeasureYear]
Measure=Time
Format=%Y

[MeasureTimeZoneISDST]
Measure=Plugin
Plugin=SysInfo
SysInfoType=TIMEZONE_ISDST
UpdateDivider=60
IfCondition=MeasureTimeZoneISDST = 1
IfTrueAction=[!SetOption MeterTimeZone MeasureName "MeasureTimeZoneDaylightName"][!SetOption MeterDSTNextChange Text "Daylight Saving Time will end#CRLF#[*MeasureDSTNextEnd*]"]
IfCondition2=MeasureTimeZoneISDST = 0
IfTrueAction2=[!SetOption MeterTimeZone MeasureName "MeasureTimeZoneStandardName"][!SetOption MeterDSTNextChange Text "Daylight Saving Time will start#CRLF#[*MeasureDSTNextStart*]"]
IfCondition3=MeasureTimeZoneISDST = -1
IfTrueAction3=[!SetOption MeterTimeZone MeasureName "MeasureTimeZoneStandardName"][!HideMeterGroup TimeZone]
OnChangeAction=[!UpdateMeasureGroup TimeZone][!UpdateMeter *][!Redraw]

[MeasureTimeZoneBias]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_BIAS
UpdateDivider=-1

[MeasureDSTStandardBias]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_STANDARD_BIAS
UpdateDivider=-1

[MeasureDSTDaylightBias]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_DAYLIGHT_BIAS
UpdateDivider=-1

[MeasureDSTCurrentBias]
Measure=Calc
Group=TimeZone
Formula=MeasureTimeZoneISDST = 1 ? MeasureDSTDaylightBias : MeasureDSTStandardBias 
UpdateDivider=-1

[MeasureCalcBiasHours]
Measure=Calc
Group=TimeZone
Formula=0-(trunc((MeasureTimeZoneBias + MeasureDSTCurrentBias) / 60))
RegExpSubstitute=1
Substitute="^([\d]{1,2})$":"+\1"
UpdateDivider=-1

[MeasureCalcBiasMinutes]
Measure=Calc
Group=TimeZone
Formula=Abs(60 * (frac(MeasureTimeZoneBias / 60)))
RegExpSubstitute=1
Substitute="^(\d)$":"\10"
UpdateDivider=-1

[MeasureTimeZoneStandardName]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_STANDARD_NAME
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^(.*)$":"\1 [UTC [MeasureCalcBiasHours]:[MeasureCalcBiasMinutes]]"
DynamicVariables=1

[MeasureTimeZoneDaylightName]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_DAYLIGHT_NAME
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^(.*)$":"\1 [UTC [MeasureCalcBiasHours]:[MeasureCalcBiasMinutes]]"
DynamicVariables=1

[MeasureDSTStartThisYear]
Measure=Time
Group=TimeZone
TimeStamp=DSTStart
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTEndThisYear]
Measure=Time
Group=TimeZone
TimeStamp=DSTEnd
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTStartNextYear]
Measure=Time
Group=TimeZone
TimeStamp=DSTStart([MeasureYear]+1)
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTEndNextYear]
Measure=Time
Group=TimeZone
TimeStamp=DSTEnd([MeasureYear]+1)
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTNextStart]
Measure=Time
Group=TimeZone
TimeStamp=DSTNextStart
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTNextEnd]
Measure=Time
Group=TimeZone
TimeStamp=DSTNextEnd
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

; Meters

;[MeterBack]
;Meter=Image
;W=360
;H=225
;SolidColor=20,30,40,255
;SolidColor2=30,40,50,255

[MeterNow]
Meter=String
MeasureName=MeasureNow
X=0
Y=0
FontSize=12
FontColor=230,240,250,255
Padding=10,10,0,0
AntiAlias=1

[MeterTimeZone]
Meter=String
X=0
Y=10R
FontSize=11
FontColor=230,240,250,255
Padding=10,0,10,0
AntiAlias=1

[MeterDSTNextChange]
Meter=String
Group=TimeZone
X=0
Y=10R
FontSize=11
FontColor=230,240,250,255
Padding=10,0,10,0
AntiAlias=1

[MeterDSTThisYear]
Meter=String
Group=TimeZone
MeasureName=MeasureDSTStartThisYear
MeasureName2=MeasureDSTEndThisYear
X=0
Y=10R
FontSize=11
FontColor=230,240,250,255
Padding=10,0,10,0
AntiAlias=1
Text=This year's Daylight Saving Time changes:#CRLF#Start	%1#CRLF#End	%2

[MeterDSTNext]
Meter=String
Group=TimeZone
MeasureName=MeasureDSTStartNextYear
MeasureName2=MeasureDSTEndNextYear
X=0
Y=10R
FontSize=11
FontColor=230,240,250,255
Padding=10,0,10,10
AntiAlias=1
Text=Next year's Daylight Saving Time changes:#CRLF#Start	%1#CRLF#End	%2
1.jpg
;-)
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mlb Live Scores

Post by balala »

Yes, I check a while ago this code.
jake2456
Posts: 89
Joined: June 8th, 2015, 10:39 pm

Re: Mlb Live Scores

Post by jake2456 »

that link i gave yesterday was only for yesterdays games. Heres todays link http://gd2.mlb.com/components/game/mlb/year_2016/month_05/day_07/scoreboard.xml otherwise you can go can always go here http://gd2.mlb.com/components/game/mlb/year_2016/ select what month then select day and then the scoreboard.xml link if your still working on that problem.

I did come across this regex=(?siU)(?:[a-zA-Z'-]+[^a-zA-Z'-]+){0,5}detmlb but then i cant figure out how to get it to select that game outs= at the begging of the line. if i add .*outs="(.*)" it actually jumps to the next games info bellow that. I dont know if that helps or not. just something i found that seems to do what i want but cant figure out to select any of that info it gets before the teamcode(in this case detmlb)

I did do an update to my skin. An have my outs info parsed from a different page. but like i said before i think its just more efficient to parse as much from one page rather then have a to pull info from a bunch of othere different webpages.

Heres a list of team codes i think the giants game just started(sfnmlb)

Code: Select all

anamlb - Los Angeles Angels
milmlb - Milwaukee Brewers
arimlb - Arizona D-backs
miamlb - Miami Marlins
atlmlb - Atlanta Braves
nynmlb - New York Mets
bosmlb - Boston Red Sox
chamlb - Chicago White Sox
chnmlb - Chicago Cubs
pitmlb - Pittsburgh Pirates
colmlb - Colorado Rockies
sdnmlb - San Diego Padres
detmlb - Detroit Tigers
clemlb - Cleveland Indians
lanmlb - Los Angeles Dodgers
tbamlb - Tampa Bay Rays
minmlb - Minnesota Twins
houmlb - Houston Astros
nyamlb - New York Yankees
balmlb - Baltimore Orioles
phimlb - Philadelphia Phillies
slnmlb - St. Louis Cardinals
seamlb - Seattle Mariners
oakmlb - Oakland Athletics
sfnmlb - San Francisco Giants
cinmlb - Cincinnati Reds
texmlb - Texas Rangers
tormlb - Toronto Blue Jays
wasmlb - Washington Nationals
kcamlb - Kansas City Royals
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mlb Live Scores

Post by balala »

It's very weird. I couldn't make it to return many things, but here is a code. Please check it and tell me what you think:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
Team=texmlb

[MeasureYear]
Measure=Time
Format=%Y

[MeasureMonth]
Measure=Time
Format=%m

[MeasureDay]
Measure=Time
Format=%d

[MeasureScores]
Measure=Plugin
Plugin=WebParser
URL=http://gd2.mlb.com/components/game/mlb/year_[&MeasureYear]/month_[&MeasureMonth]/day_[&MeasureDay]/scoreboard.xml
RegExp=(?siU).g_game outs="(.*)".*game id="[MeasureYear]_[MeasureMonth]_[MeasureDay]_(.*)_(.*)_(.*)".*status="(.*)"
.*start_time="(.*)"

[MeasureGameOuts]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScores]
StringIndex=1

[MeasureGameID1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScores]
StringIndex=2

[MeasureGameID2]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScores]
StringIndex=3

[MeasureGameID3]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScores]
StringIndex=4

[MeasureGameStartTime]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScores]
StringIndex=5

[MeasureGameStatus]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScores]
StringIndex=6

[MeterGame]
Meter=STRING
MeasureName=MeasureGameOuts
MeasureName2=MeasureGameID1
MeasureName3=MeasureGameID2
MeasureName4=MeasureGameID3
MeasureName5=MeasureGameStatus
MeasureName6=MeasureGameStartTime
MeasureName7=MeasureGameOutsSecond
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=10
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Game Outs: %1#CRLF#GameID: %2 - %3 - %4#CRLF#Game Start Time: %5#CRLF#Game Status: %6
For sure it's not yet exactly what you'd like. The problem is that if in the RegExp, instead of the second or third (.*) I add the detmlb expression, I get very different from what I'd need. Weird...
jake2456
Posts: 89
Joined: June 8th, 2015, 10:39 pm

Re: Mlb Live Scores

Post by jake2456 »

Well the problem im seeing there is that its still pulling the outs="(.*)" info from the first instance of that it finds on that page and not the specific one for a game.

Looking at the Regular Expressions Cheat Sheet trying to figure out what might work. I finally came up with something that works correctly.

Code: Select all

URL=http://gd2.mlb.com/components/game/mlb/year_2016/month_05/day_08/scoreboard.xml
RegExp=(?miU)(outs="(.*)">
      <game id="2016_05_08_nynmlb_sdnmlb_1").*status="(.*)"
.*start_time="(.*)"
If you notice i changed (?siU) to (?miU) and then grouped outs="(.*)">
<game id="2016_05_08_nynmlb_sdnmlb_1"
Next step would be to figure out the how to add lookahead assertion for outs inside a group. So far my trys with that have failed.
jake2456
Posts: 89
Joined: June 8th, 2015, 10:39 pm

Re: Mlb Live Scores

Post by jake2456 »

The regexp line seems to work in RainRegExp but not in a skin. Do Skins not support Multiple lines?
User avatar
jsmorley
Developer
Posts: 22715
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Mlb Live Scores

Post by jsmorley »

jake2456 wrote:The regexp line seems to work in RainRegExp but not in a skin. Do Skins not support Multiple lines?
No they do not. The INI format in general doesn't support multiple lines in options.
jake2456
Posts: 89
Joined: June 8th, 2015, 10:39 pm

Re: Mlb Live Scores

Post by jake2456 »

Well there went that idea, but essentially this should do the same thing right?

Code: Select all

RegExp=(?siU)(game outs="(.*)">.*<game id="2016_05_08_bosmlb_nyamlb_1).*status="(.*)".*start_time="(.*)"
Ill have to wait to test that though tell tomorrow night to see if it works properly.

Can anyone tell me why this isnt working. Im assuming it has something to do with the gid and gameid sections of the RegExps

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
Team=bosmlb

[MeasureYear]
Measure=Time
Format=%Y

[MeasureMonth]
Measure=Time
Format=%m

[MeasureDay]
Measure=Time
Format=%d

[MeasureScoresTeam]
Measure=Plugin
Plugin=WebParser
URL=http://gd2.mlb.com/components/game/mlb/year_[&MeasureYear]/month_[&MeasureMonth]/day_[&MeasureDay]
RegExp=(?siU).*#Team#.*/"> .*gid_[MeasureYear]_[MeasureMonth]_[MeasureDay]_(.*)_(.*)_1
DynamicVariables=1

[MeasureTeam1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScoresTeam]
StringIndex=1
DynamicVariables=1

[MeasureTeam2]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScoresTeam]
StringIndex=2
DynamicVariables=1

[MeasureScores]
Measure=Plugin
Plugin=WebParser
URL=http://gd2.mlb.com/components/game/mlb/year_[&MeasureYear]/month_[&MeasureMonth]/day_[&MeasureDay]/scoreboard.xml
RegExp=(?siU)(?siU)(game outs="(.*)">.*<game id="[MeasureYear]_[MeasureMonth]_[MeasureDay]_[MeasureTeam1]_[MeasureTeam2]_1).*status="(.*)".*start_time="(.*)"
DynamicVariables=1

[MeasureGameOuts]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScores]
StringIndex=2

[MeasureGameStartTime]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScores]
StringIndex=4

[MeasureGameStatus]
Measure=Plugin
Plugin=WebParser
Url=[MeasureScores]
StringIndex=3

[MeterGame]
Meter=STRING
MeasureName=MeasureGameOuts
MeasureName2=MeasureGameStatus
MeasureName3=MeasureGameStartTime
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=10
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Game Outs: %1#CRLF#Game Start Time: %3#CRLF#Game Status: %2
jake2456
Posts: 89
Joined: June 8th, 2015, 10:39 pm

Re: Mlb Live Scores

Post by jake2456 »

Hey am i using these if actions correctly? What im trying to do is if the measure doesnt capture anything to set text= in that meter to nothing.

Code: Select all

[MeasureBatterF]
Measure=Plugin
Plugin=WebParser
Url=[MeasureLinescore]
StringIndex=38
IfMatch=[MeasureBatterF]
IfMatchAction=[!SetOption mBatter Text "AB: [MeasureBatterF] [MeasureBatterL"]
IfNotMatchAction=[!SetOption mBatter Text ""]
IfMatchMode=1
DynamicVariables=1

[MeasureBatterL]
Measure=Plugin
Plugin=WebParser
Url=[MeasureLinescore]
StringIndex=39
DynamicVariables=1

[mBatter]
Meter=String
MeasureName=MeasureBatterF
MeasureName2=MeasureBatterL
MeterStyle=OddStyle
StringAlign=Left
FontColor=250,70,22
X=5
Y=127
Text=AB: %1 %2
DynamicVariables=1
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mlb Live Scores

Post by balala »

1. The !SetOption bang in the IfMatchAction option of the [MeasureBatterF] lost a bracket: IfMatchAction=[!SetOption mBatter Text "AB: [MeasureBatterF] [MeasureBatterL[color=#FF0000]][/color]"].
2. The value of the [MeasureBatterF] measure will always match [MeasureBatterF]. So, in fact the IfMatchAction will always be executed. Maybe you wanted to use the IfMatch=[MeasureBatterL], instead of IfMatch=[MeasureBatterF]?
3. Instead of [!SetOption mBatter Text "AB: [MeasureBatterF] [MeasureBatterL]"] bang, you could try this: [!SetOption mBatter Text "AB: %1 %2"], because you anyway have set the MeasureName=MeasureBatterF and the MeasureName2=MeasureBatterL options on the [mBatter] meter. The DynamicVariables=1 option of this last meter also could be removed, because it looks to be useless.