It is currently December 7th, 2023, 4:35 pm

MLB Standings

RSS, ATOM and other feeds, GMail, Stocks, any information retrieved from the internet
User avatar
kfonda
Posts: 19
Joined: May 8th, 2015, 8:15 pm
Location: Manasquan, NJ USA

Re: MLB Standings

Post by kfonda »

Thank you very much. I was comparing the code from the old and new versions and see that the changes were quite significant... completely different website, even. You make these skins look almost easy. I hope you know that your work is very much appreciated, including all the teaching you do in the forums here.

Kevin Fonda
User avatar
jsmorley
Developer
Posts: 22593
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MLB Standings

Post by jsmorley »

kfonda wrote:Thank you very much. I was comparing the code from the old and new versions and see that the changes were quite significant... completely different website, even. You make these skins look almost easy. I hope you know that your work is very much appreciated, including all the teaching you do in the forums here.

Kevin Fonda
Yeah, the CBSSports site I was using has just made it stupidly hard to parse with a recent change, so I switched to NBCSports, which has a relatively simply site.

That MLBStandings skin is one I fire up myself at least once a day to check things out. I'm a Washington Nationals fan, so while I have VERY little sympathy for you, :-) I'm still a bit nervous myself with the Braves hanging in there as well as they are this year.
User avatar
kfonda
Posts: 19
Joined: May 8th, 2015, 8:15 pm
Location: Manasquan, NJ USA

Re: MLB Standings

Post by kfonda »

Just you wait 'til next year :17angry ( I've been saying that for most of the last 50 years).

BTW, was the CBS issue something to do with the little check box at the top and all the nearly impossible to sort out results? I did try to actually fix it myself, but I couldn't get the webparsed results to show anything like what you were looking for in the original version.
User avatar
jsmorley
Developer
Posts: 22593
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MLB Standings

Post by jsmorley »

kfonda wrote:Just you wait 'til next year :17angry ( I've been saying that for most of the last 50 years).

BTW, was the CBS issue something to do with the little check box at the top and all the nearly impossible to sort out results? I did try to actually fix it myself, but I couldn't get the webparsed results to show anything like what you were looking for in the original version.
I didn't dig in very deep, as it was apparent at first glance that they had made it much more difficult to uniquely identify the different bits of information, so I quickly started looking for an easier alternative. Doesn't matter all that much where you get it from, the information is all the same. Mostly just want a site that updates as soon as possible after games are over.
RMBill
Posts: 5
Joined: June 10th, 2020, 2:33 am

Re: MLB Standings

Post by RMBill »

Any chance for updates in the year 2023? This has been a great program.

RMBill
User avatar
Yincognito
Rainmeter Sage
Posts: 6406
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MLB Standings

Post by Yincognito »

RMBill wrote: July 5th, 2023, 7:16 pm Any chance for updates in the year 2023? This has been a great program.

RMBill
First is this, in the [Variables] section of MLBStandings.ini:

Code: Select all

League=NL
Division=East
Team=.*<span class="td-teamAbbr">(.*)<\/span>.*<span class="td-teamLocation">(.*)<\/span>.*<span class="td-teamName">(.*)<\/span>.*
Entry=.*<tr>.*<td .*>#Team#<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<td .*>(.*)<\/td>.*<\/tr>.*
and this, in [MeasureSite]:

Code: Select all

URL=https://www.nbcsports.com/mlb/standings
RegExp=(?siU)<bsp-tabs .*>.*<div class="TableGroup-title">#League#<\/div>.*<div class="Table-title">#Division#<\/div>.*<table .*>.*<tbody>#Entry##Entry##Entry##Entry##Entry#<\/tbody>.*<\/table>.*<\/bsp-tabs>
The above changes will give you everything of skin interest from the site, and you can see that by watching the value of the measures in the log's Skins Tab.

Next, is adjusting the other measures / meters to the new reality (e.g. more captures for a table line / team i.e. the 3 from the Team variable and the 11 from the Entry variable compared to the earlier 8, some new substitutes here and there, some slight measure referencing changes in some meters) - this is only for the first line / team, you do the rest by looking at what was changed:

Code: Select all

[MeasureInitials1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1
RegExpSubstitute=1
Substitute="&nbsp;":""

[MeasureTeamLocation1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=2
RegExpSubstitute=1
Substitute="&nbsp;":""

[MeasureTeam1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=3
RegExpSubstitute=1
Substitute="&nbsp;":""

[MeasureWon1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=4
RegExpSubstitute=1
Substitute="(?:^\s+|\s+$)":""

[MeasureLost1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=5
RegExpSubstitute=1
Substitute="(?:^\s+|\s+$)":""

[MeasurePercentage1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=6
RegExpSubstitute=1
Substitute="(?:^\s+|\s+$)":""

[MeasureGamesBack1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=7
RegExpSubstitute=1
Substitute="(?:^\s+|\s+$)":"","-":"---","&frac12;":".5"

[MeasureLastTen1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=13
RegExpSubstitute=1
Substitute="(?:^\s+|\s+$)":""

[MeasureStreak1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=14
RegExpSubstitute=1
Substitute="(?:^\s+|\s+$)":""

Code: Select all

[MeterName1]
Meter=String
X=75
Y=18r
FontSize=13
FontColor=#TeamColor#
SolidColor=0,0,0,1
StringStyle=Bold
AntiAlias=1
StringCase=Proper
Text=[MeasureTeamLocation1] [MeasureTeam1]
DynamicVariables=1
Lastly, making sure you use the league initials instead of their full name in the LeftMouseUpAction options from 6 of the last 7 meters in the skin, e.g. "AL" instead of "American League", "NL" instead of "National League", so you can click on the bottom buttons and switch to the desired league / division.

As for the rest, there is some Lua scripting when it comes to the "logos", to show them as that nice font based on their initials, but I'll skip that - the approach might be outdated by now, maybe jsmorley knows better.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RMBill
Posts: 5
Joined: June 10th, 2020, 2:33 am

Re: MLB Standings

Post by RMBill »

Great. Thank you. Just need to fine tune it.

RMBill
User avatar
Yincognito
Rainmeter Sage
Posts: 6406
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MLB Standings

Post by Yincognito »

RMBill wrote: July 15th, 2023, 12:49 pm Great. Thank you. Just need to fine tune it.

RMBill
You're welcome - good luck with fine tuning it and enjoy! ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
kfonda
Posts: 19
Joined: May 8th, 2015, 8:15 pm
Location: Manasquan, NJ USA

Re: MLB Standings

Post by kfonda »

RMBill wrote: July 15th, 2023, 12:49 pm Great. Thank you. Just need to fine tune it.

RMBill
If you get it working, I would really appreciate it if you could post it here. I like to keep up to date on the standings even though I am a Mets fan. :(
User avatar
Yincognito
Rainmeter Sage
Posts: 6406
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MLB Standings

Post by Yincognito »

kfonda wrote: July 15th, 2023, 1:40 pm If you get it working, I would really appreciate it if you could post it here. I like to keep up to date on the standings even though I am a Mets fan. :(
Small correction: it's already "working", just not complete. I intentionally left a few copy pasting and small adjustments that any of you folks can make... if you really like to have those standings on your screens and don't consider copy pasting difficult, that is. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth