Site
Home / Forum / General Discussion / MLB

MLB


Posted: 11 Apr 2017 22:09

zag


Posts: 3,511
Joined: 2020

Hi I have been adding events for MLB but just like NHL and NBA there are so many!! I have attached a CSV of the next 7 days worth of games wondering if there is a way to automate it like some of the other leagues.

https://1drv.ms/u/s!AqF18UiYK6SppmPvl0Yn34SPqhum

Cheers,

Posted: 11 Apr 2017 23:03

zag


Posts: 3,511
Joined: 2020

I have also noticed that the API for all the teams doesn't have "strTeamShort" for any of the teams. Can't seem to find how to add those short codes for the teams.

I have made a CSV for that as well

https://1drv.ms/u/s!AqF18UiYK6SppmehNfw2oBHoUh6V

Cheers,

Posted: 16 Apr 2017 12:37

zag


Posts: 3,511
Joined: 2020

Thanks! I will take a look a this soon.

You are corrent that a short name will be really useful, I will update.

shame there is no real MLB api available, otherwise I would try to automate it. CSV files are good, but not really a long term solution.

Posted: 09 Aug 2017 15:17

zag


Posts: 3,511
Joined: 2020

You could scrape the mlb website that has all the data. I grab data each day for sabermetrics stuff...

Below is an example of the boxscore.xml file from last nights game

<boxscore game_id="2017/08/08/balmlb-anamlb-1" game_pk="491776" venue_id="1" venue_name="Angel Stadium of Anaheim" home_sport_code="mlb" away_team_code="bal" home_team_code="ana" away_id="110" home_id="108" away_fname="Baltimore Orioles" home_fname="Los Angeles Angels" away_sname="Baltimore" home_sname="LA Angels" date="August 8, 2017" away_wins="56" away_loss="57" home_wins="56" home_loss="58" status_ind="F">


Just grab the game where status_ind = "F" (Finished). You've got the date and the teams there, scrape a table and insert it.

Posted: 09 Aug 2017 15:30

zag


Posts: 3,511
Joined: 2020

Thanks that's really useful info, I will look into it.


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 5 (Total: 5)