Comments (4)
I have a mostly-working version of this locally. There are some oddities, e.g. Columbia is also abbreviated COL
, so it ends up purple.
Here's the relevant code:
games = statsapi.schedule(self.date.strftime("%Y-%m-%d"))
# WBC - Id 51 is "International Baseball"
games += statsapi.schedule(sportId="51", date=self.date.strftime("%Y-%m-%d"))
# sort and de-duplicate
sorted_games = sorted(
games, key=lambda a: datetime.strptime(a["game_datetime"], "%Y-%m-%dT%H:%M:%SZ")
)
latest = None
self.__all_games = []
for game in sorted_games:
if game["game_id"] != latest:
self.__all_games.append(game)
latest = game["game_id"]
which you can replace this line:
mlb-led-scoreboard/data/schedule.py
Line 46 in 2f40068
with, if you'd like. I'm not sure if we will support this "officially" or not, since it's a limited time thing and only every 4 years
from mlb-led-scoreboard.
I've implemented this piece of code in the schedule.py file. Everything seems to pick up the WBC games. I need to work through shortening some of the longer names and adding custom colors for the international teams. Thanks again!
from mlb-led-scoreboard.
We can get "International Baseball" easily by requesting sportId 51
in the schedule API call, but this will include duplicates of the exhibition games (e.g., on Thursday the Cardinals are playing Nicaragua) which are also listed in the normal MLB listing (sportId 1
).
I can't figure out if there's a way to request only the WBC games, it seems requesting leagueId:160
has no effect.
There would need to be a few other changes to e.g. teams.py, and obviously there wouldn't be built-in colors for them either
from mlb-led-scoreboard.
With the WBC over, I think we can close this.
from mlb-led-scoreboard.
Related Issues (20)
- [Feature Request] Add time delay to scoreboard update to account for streaming tv delay
- Add Pitch Count Clock HOT 4
- I created a new w64h32.json and re ran install.sh but is still splitting into two 32 by 32 screens. HOT 3
- If emoji is present in News Article Title, then python script crashes due to a ZeroDivisionError HOT 12
- Scoreboard >= v6.3.0 causes games to get "stuck" without rotating HOT 10
- Add result of previous play to game screen
- Add support for 96 x 48 matrix HOT 1
- Issue when trying to set Dbacks as preferred team HOT 9
- Delayed game still showed start time HOT 1
- Units of measurement not working HOT 2
- Scoreboard not starting with one team config and offday HOT 2
- Turning off scrolling text HOT 4
- Option to display team record on game screen HOT 2
- Trouble starting up when plugged in HOT 7
- Top Half of screen is green HOT 2
- Verify software compatibility with Raspberry Pi 5 HOT 1
- Error when installing HOT 3
- Create Image HOT 1
- Just set up the hardware and I have an issue starting the software HOT 6
- no module stats API HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlb-led-scoreboard.