Site
Home / Forum / Developers / MLB intHomeScore and intAwayScore = null

MLB intHomeScore and intAwayScore = null


Posted: 27 Apr 2018 16:20

zag


Posts: 3,515
Joined: 2020

Hello, I am out of my comfort zone here and am hoping not to look too dumb or break any forum rules. Sorry in advance if either of those happen.

I'm trying to display MLB scores from the previous day's games via javascript. Everything seems to be up and working just fine other then null values for some of the games. I read through both 'MLB strTime format' (t=4093) and 'strTime is null for NHL' (t=4090) which led me to check out statsapi.mlb.com. If I understand things correctly (which is highly doubtful, as I am not really a programmer) TheSportsDB is pulling from statsapi.mlb.com to automatically update the MLB info. The below mlb URL contains the 'score' info while thesportsdb contains some null info. Am I looking/thinking about this all wrong or is there a discrepancy?

https://statsapi.mlb.com/api/v1/schedule ... ,media(epg)))&language=en

https://www.thesportsdb.com/api/v1/json ... hp?id=4424

Posted: 29 Apr 2018 17:55

zag


Posts: 3,515
Joined: 2020

I think MLB importer has some problems since many results are missing
https://www.thesportsdb.com/season.php?l=4424&s=2018
Many games were cancelled but I don't believe in such big numbers.

Posted: 01 May 2018 15:55

zag


Posts: 3,515
Joined: 2020

Hmm looks like the importer broke, I will take a look.

Posted: 02 May 2018 14:24

zag


Posts: 3,515
Joined: 2020

Just for my own info, this is the API we use. It looks like they stopped supporting it

https://gd2.mlb.com/components/game/mlb/ ... board.json

{"subject": "master_scoreboard", "copyright": "NOTICE: This file is no longer actively supported. Please use the MLB Stats API (http://statsapi.mlb.com/docs/) as an alternative. Copyright 2018 MLB Advanced Media, L.P. Use of any content on this page acknowledges agreement to the terms posted here http://gdx.mlb.com/components/copyright.txt", "data": {"games": {"day": "01", "modified_date": "2018-05-02T14:25:56Z", "month": "02", "next_day_date": "2018-02-02", "xmlns:xs": "http://www.w3.org/2001/XMLSchema", "year": "2018"}}}


Posted: 02 May 2018 15:38

zag


Posts: 3,515
Joined: 2020

Hopefully fixed now although I didn't write an importer for the missing scores yet.

Lets see if it updates over the next few days.

Posted: 02 May 2018 19:37

zag


Posts: 3,515
Joined: 2020


Mine importer was bases on statsapi btw
Also please think about converting times to eastern from utc

Posted: 03 May 2018 08:43

zag


Posts: 3,515
Joined: 2020


Mine importer was bases on statsapi btw
Also please think about converting times to eastern from utc


Yep I struggled with the UTC thing yesterday, it also effects the dates of the matches which becomes a bit of a nightmare!

I'm still thinking of having a 2nd DB field for "strLocalTime" or something like that

Posted: 05 May 2018 21:37

zag


Posts: 3,515
Joined: 2020

it also effects the dates of the matches
Yeah, That's the main purpose!

Posted: 15 May 2018 13:21

zag


Posts: 3,515
Joined: 2020

I know I started this thread and then seemed to have disappeared. I just wanted to let you both know that, even though I haven't been able to contribute anything helpful, I have been paying attention and appreciate all of what you have / continue to do for TheSportsDB. Thank You.

Posted: 16 May 2018 16:19

zag


Posts: 3,515
Joined: 2020

I think testing and bug hunting are very important to zag as developer

Posted: 21 May 2018 13:53

zag


Posts: 3,515
Joined: 2020

Yes keep them coming, I have a todo list ready to go. I still update the site regularly and will even add some new leagues this summer.

Baseball looks like its working nicely, but they changed some of the fixture dates which is a bit annoying.

Posted: 13 Jun 2018 20:35

zag


Posts: 3,515
Joined: 2020

Ah, MLB importer has problems, unfortunately.
Not all games are populated with scores

Posted: 15 Jun 2018 10:55

zag


Posts: 3,515
Joined: 2020

Seems to be working as expected, the ones that are not populating probably have changed date for tv coverage.

Not much I can do about that at this stage I don't think.


Who is Online?

In total there are 68 users online :: 3 registered, 0 hidden and 65 guests (based on users active over the past 5 minutes) Most users ever online was 424 on Fri Nov 10, 2017 9:02 pm

About Us

Discussion forum for TheSportsDB.com site and related topics

Rules

- Be Polite
- Respect other users
- Always post log files with issues
- Try to be helpful
- No Piracy discussion

Showing 0 to 13 (Total: 13)