Well i have been able to get live scores working. Pretty much the same as the old one. Just seems to be a few bugs im trying to work out. regarding the regexp code. I thought i had it all worked out last night but seems to have broke for today. Thinking ill have to use more of the look ahead assertions.
As far as the images for your standings app. You could use the images included in the resources folder of my old version of my scoreboard. I do believe they are png.
It is currently September 8th, 2024, 2:21 am
Mlb Live Scores
-
- Posts: 89
- Joined: June 8th, 2015, 10:39 pm
-
- Rainmeter Sage
- Posts: 8030
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Mlb Live Scores
Indeed. If you already have an older version built on a similar foundation, it's easier to upgrade. Just curious, where do you get that MLB API from? Does it come as a JSON or similar, avoiding the need to parse the webpage?jake2456 wrote: ↑September 2nd, 2023, 3:04 pm Well i have been able to get live scores working. Pretty much the same as the old one. Just seems to be a few bugs im trying to work out. regarding the regexp code. I thought i had it all worked out last night but seems to have broke for today. Thinking ill have to use more of the look ahead assertions.
As far as the images for your standings app. You could use the images included in the resources folder of my old version of my scoreboard. I do believe they are png.
![Confused :???:](./images/smilies/bw.gif)
-
- Posts: 89
- Joined: June 8th, 2015, 10:39 pm
Re: Mlb Live Scores
For example heres a link to a game today. https://statsapi.mlb.com/api/v1.1/game/716755/feed/live It does show up as json for me an i switch to raw data for the web parse. is there i new feature or way im not aware of? remember just getting back into rainmeter an have mostly just used what i remember doing years ago.Yincognito wrote: ↑September 2nd, 2023, 4:53 pm Indeed. If you already have an older version built on a similar foundation, it's easier to upgrade. Just curious, where do you get that MLB API from? Does it come as a JSON or similar, avoiding the need to parse the webpage?![]()
You need to know the right links to get the data you are looking for. i found a few githubs explaining things. I do believe you can register with them also for a free login.
https://github.com/toddrob99/MLB-StatsAPI/blob/master/statsapi/endpoints.py
https://github.com/brianhaferkamp/mlbapidata
-
- Rainmeter Sage
- Posts: 8030
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Mlb Live Scores
Ah, that's nice, thanks for the info - knowing the right links is indeed quite useful. Yes, it's a JSON for me too on my phone, and I suppose on my laptop as well, can't see a reason why it would be otherwise. No, using WebParser as you do is the typical way to parse that data, although there is at least one JSON plugin for Rainmeter that I know of, which in theory would make the data access easier:jake2456 wrote: ↑September 2nd, 2023, 6:02 pm For example heres a link to a game today. https://statsapi.mlb.com/api/v1.1/game/716755/feed/live It does show up as json for me an i switch to raw data for the web parse. is there i new feature or way im not aware of? remember just getting back into rainmeter an have mostly just used what i remember doing years ago.
You need to know the right links to get the data you are looking for. i found a few githubs explaining things. I do believe you can register with them also for a free login.
https://github.com/toddrob99/MLB-StatsAPI/blob/master/statsapi/endpoints.py
https://github.com/brianhaferkamp/mlbapidata
https://forum.rainmeter.net/viewtopic.php?t=34378
Of course, it's debatable whether the data access will be easier when the JSON is dynamic in nature, but you can experiment with it if you want.
-
- Posts: 89
- Joined: June 8th, 2015, 10:39 pm
Re: Mlb Live Scores
I think i finally got it to parse correctly after a lot of trial and error. Fingers Crossed. Just need to wait tell tomorrow to find out for sure. Then the real fun begins with creating a new look.
-
- Posts: 89
- Joined: June 8th, 2015, 10:39 pm
Re: Mlb Live Scores
I could use some help. I dont know enough about regexp to get it to work correctly. Games played, currently playing, or coming in next few hours seem to read fine but games farther out in the day or next day dont work. Ive trial and errored this many times but am at a lose.
Replace [&MeasureGameId1] in url with 716755 for yesterdays game example and use 716735 or [&MeasureGameId1] for a game today. 716713 for a game on monday.
Replace [&MeasureGameId1] in url with 716755 for yesterdays game example and use 716735 or [&MeasureGameId1] for a game today. 716713 for a game on monday.
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 8030
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Mlb Live Scores
Didn't check the skin yet, but just from the top of my head, are you sure you didn't exceed the maximum of 99 captures in a regex pattern, supported by Rainmeter?jake2456 wrote: ↑September 3rd, 2023, 4:27 pm I could use some help. I dont know enough about regexp to get it to work correctly. Games played, currently playing, or coming in next few hours seem to read fine but games farther out in the day or next day dont work. Ive trial and errored this many times but am at a lose.
Replace [&MeasureGameId1] in url with 716755 for yesterdays game example and use 716735 or [&MeasureGameId1] for a game today. 716713 for a game on monday.
-
- Posts: 89
- Joined: June 8th, 2015, 10:39 pm
Re: Mlb Live Scores
As in (.*)? There's I think around just 50 at the moment.
-
- Rainmeter Sage
- Posts: 8030
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
-
- Rainmeter Sage
- Posts: 8030
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Mlb Live Scores
And I don't know enough about baseball to get what doesn't work. I mean, according to your "innings" capture of home and away runs, the skin displays exactly what it's told to - albeit only stuff about a single game in that day (which, IMHO, is not what a live scoreS should look like, but anyway). I did notice, however, that at times the skin doesn't display anything, even though it used to do for the same thing - not sure yet what would be the reason, maybe you're not accounting for spaces in all places.jake2456 wrote: ↑September 3rd, 2023, 4:27 pmI dont know enough about regexp to get it to work correctly. Games played, currently playing, or coming in next few hours seem to read fine but games farther out in the day or next day dont work. Ive trial and errored this many times but am at a lose.
Replace [&MeasureGameId1] in url with 716755 for yesterdays game example and use 716735 or [&MeasureGameId1] for a game today. 716713 for a game on monday.
I'll say this though: your lookahead assertions are not exactly correct. Instead of like this:
(?(?=.*"innings".*"num":1,.*"home".*"runs":(.*),.*"away".*"runs":(.*),))
they should be like this:
(?(?=.*"innings".*"num":1,.*"home".*"runs":.*,.*"away".*"runs":.*,).*"innings".*"num":1,.*"home".*"runs":(.*),.*"away".*"runs":(.*),)
So basically, it's (?(?=ConditionToMatchWithoutCaptures)ActualMatchWithCaptures) - in your code, the second part is empty. Obviously, you don't need the condition to be the entire actual match, it can be just the sufficient part of it, for example:
(?(?=.*"innings".*"num":1,).*"innings".*"num":1,.*"home".*"runs":(.*),.*"away".*"runs":(.*),)
or something like that.