
Playball: Watch MLB games from the comfort of your own terminal - computerlab
https://github.com/paaatrick/playball
======
jrumbut
I was really hoping this would render a small video in terminal colors.

Regardless, love it and love that you're bringing baseball to it's biggest new
market, unix sysadmins.

~~~
kick
You can do that with mpv pretty easily.

mpv "[http://SOURCEURL"](http://SOURCEURL") \--vo=caca

Example:

mpv
"[https://www.youtube.com/watch?v=xYQiqBwczB0"](https://www.youtube.com/watch?v=xYQiqBwczB0")
\--vo=caca

OR, for a higher-quality terminal-rendered video:

mpv
"[https://www.youtube.com/watch?v=xYQiqBwczB0"](https://www.youtube.com/watch?v=xYQiqBwczB0")
\--vo=tct

~~~
SanchoPanda
this was really useful, thank you

~~~
kick
Always happy to share!

------
dcchambers
I don't even really like Baseball that much but I love everything about this.
I love terminal apps for things you'd never think of, especially when they're
fully-featured and beautiful such as this. This has no business existing - yet
here we are...and it's amazing.

------
KevinEldon
The developer also created a visualization of each team's minor league system
[1]. It's an interesting visualization and a useful project [2] that shows the
entire data analysis process from scraping data to published visualization.

[1] [https://paaatrick.github.io/called-
up/](https://paaatrick.github.io/called-up/)

[2] [https://github.com/paaatrick/called-
up](https://github.com/paaatrick/called-up)

------
reaperducer
Love this.

When I worked remotely, I would frequently have the radio playing a baseball
game in the background for company. Now I'm back in the office and can't do
that, so this would have been great to have a few months ago.

Bookmarked for next season.

------
leg100
The MLB seems refreshingly progressive in providing a free API (although from
reading around it seems to be poorly documented).

The EPL by contrast jealously guards its stats and charges for every tidbit.

~~~
isostatic
My understanding (mainly from Star Trek) is that most of the fun of baseball
is the stats.

------
jlawer
There needs to be a cricket version of this (especially with 5 day test
matches). I don't know if the raw data is available without crazy licensing
though.

~~~
unfunco
I've been using SportMonks for football data and they do cricket too:
[https://www.sportmonks.com/cricket-api](https://www.sportmonks.com/cricket-
api)

~~~
zouhair
Well this makes me appreciate the NHL/NFL/NBA/MLB free apis.

~~~
unfunco
I've been using the free version of the football API from SportMonks whilst I
write a client, but it's limited to just a few (not so popular) leagues. I
intend on using it for commercial purposes in a few months though, and the
price compared to Opta and SportRadar is much more reasonable.

------
paganel
I wonder how difficult it would be to make this work with /r/MLBstreams,
eventually even integrating the live match thread from /r/baseball on the side
of the main screen.

------
sdca
Too bad you'll be missing a lot of the game experience this way, like the roar
of the crowd and the banging of trashcans.

~~~
oplav
For those out of the loop, the Houston Astros have been accused of stealing
signs between the pitcher and catcher by banging on a trash can in the dugout
using a camera placed in center field.

[https://www.sbnation.com/platform/amp/mlb/2019/11/12/2096191...](https://www.sbnation.com/platform/amp/mlb/2019/11/12/20961911/houston-
astros-sign-stealing-cameras-mlb)

~~~
LandR
So the guy catching the ball tells the guy throwing the ball how to throw the
ball?

And the other team is seeing what he's telling the thrower, and then
signalling that to the batter so he knows how the ball is going to be thrown?

And this is disallowed ?

yet stealing bases is allowed?

There is a lot more going on in baseball than I thought!

~~~
votepaunchy
> So the guy catching the ball tells the guy throwing the ball how to throw
> the ball?

Not quite. The catcher benefits from knowing the type of pitch in order to
actually catch the ball, but only signals pitch options which are accepted or
rejected by the pitcher.

They can also huddle if signs are being stolen, but this of course takes much
longer (hence the prohibition on sign stealing).

~~~
LandR
Sorry, not American but this seems an interesting aspect of a sport I know
nothing about!

Is this done because the catcher might know the batter is worse at hitting
pitch type X, but is better at pitch type Y, so signals to the pitcher to
throw an X?

But the pitcher might think he can't throw a good X right now (for whatever
reason), and instead will throw a Z ?

And the pitcher and catcher need to somehow secretly agree on what's being
thrown?

Does it ever happen that the catcher fails to catch it? It seems he has a
pretty small window that he needs to catch it in, but then I guess sometimes
these pitches are crazy fast and can't have much time to react.

~~~
KevinEldon
Yes, the catcher does miss the ball occasionally. It's common for the pitches
to be 90 MPH or higher. I've seen them as high as 104 MPH. The ball will also
move; it's not always thrown in a straight line. Some times it cuts across the
plate, other times it can drop as it crosses the plate. If the catcher knows
where to expect the ball they have a higher probability of catching it.

------
aquova
Out of curiosity, what are some of the advantages of making terminal apps via
JS/npm? I've been curious in making some of my own, but I've looked mostly at
ncurses in C or Rust, and haven't looked much at the JS ecosystem.

------
Yhippa
I'm not a JS expert but the code was an interesting read.

Are there other free sports API's out there? The MLB one is cool.

~~~
crobibero
There is an NHL API documented here:
[https://gitlab.com/dword4/nhlapi](https://gitlab.com/dword4/nhlapi)

~~~
oplav
MLB API documentation should be very similar. Both were built by MLB Advanced
Media.

------
anthk
Back in the day you could watch the Soccer World Cup over telnet.

[http://www.ascii-wm.net/](http://www.ascii-wm.net/)

Demo:

[https://www.youtube.com/watch?v=_VQQVTS6u_w](https://www.youtube.com/watch?v=_VQQVTS6u_w)

------
0x445442
I've seen it mentioned here that there are free apis ordained by the sports
leagues but I was under the impression that this type of live data is not
free.

I know there has been many court cases around this very issue so the question
is; are these apis really provided by the leagues?

~~~
CryptoBanker
MLB actually has two different APIs - their statcast API and their Gameday
API.

Both are free for non-commercial uses, though there is no documentation
available (any more), and any copies of the older documentation is riddled
with incorrect details.

------
neighbour
Does anyone have something similar like this for EPL football/soccer?

------
holler
Very cool! I don't watch baseball but still find this fascinating :D

------
trykondev
This is really neat -- I would absolutely love an NFL equivalent!

------
invalidusernam3
Anyone know if there is something similar for cricket?

