Playball – Watch MLB games from a terminal

(github.com)

155 points | by ohjeez 6 hours ago ago

75 comments

  • nonethewiser 3 hours ago

    Totally anecdotal, but there are people who literally get paid to watch games and record what happens at every step. I used to have that job. This is how MLB, ESPN etc. have live updates which powers stuff like this.

  • jackconsidine 3 hours ago

    What an awesome project at just the right time.

    I love baseball and I love that the hacker culture seems to love baseball too.

    I read that part of baseball's decline from the premiere American sport was due to its outdated revenue model (strict reliance on ticket sales). The NFL in 80s really embraced TV and reached more fans and here we are. MLB has been recently way ahead of the curve on streaming (MLB.tv, AWS StatCast etc).

    I hope projects like this contribute to baseball regaining popularity

    • thaack 21 minutes ago

      I think streaming is part of why I DON'T watch baseball. The DTC streaming package for my local team is $20/month. Baseball is something that I would flip on the local team and watch after work passively. The value just isn't there for $20!/month.

      I also think it has a huge negative impact on youth interest in baseball. I personally got into baseball as a kid because my father would do the same - get home from work and turn on the game because it was on OTA TV. How are you getting kids interested in the sport if they can't even watch because the parents don't want to fork over that cost? Huge ripple effect. The RSN's which typically carry a vast majority of local baseball games (mlb.tv is blacked out for local markets) bet big on streaming and lost a ton of money[1]. They, in turn, attempted to gouge the remaining dedicated fans at an inflated cost. I already pay $82/month for YoutubeTv. If it's not on there, I just won't watch - in turn, I also go to the ballpark less and really don't keep up with the local team at all.

      [1] Bally Sports (Diamond Sports Group) 2023 Bankruptcy

    • spike021 3 hours ago

      I just wish MLB and its broadcasters weren't pushing gambling so hard. It's ridiculous and bringing so much toxicity to the sport.

      • nonethewiser 3 hours ago

        I fully support sports gambling being legal but holy shit, the legalization of sports gambling in the USA had such a terrible effect on sports coverage.

        I have not watched the MLB in a while so I don't know specifically what you are talking about but I can imagine.

        • Jeremy1026 3 hours ago

          There is an ad for a sports book on screen no less than 50% of a broadcast, not including ad breaks, for the majority of teams. Either it's an ad behind home plate, a jersey patch, the broadcasters themselves reading the latest odds, or a combination of those and more. It is absolutely insane.

        • hoistbypetard 2 hours ago

          I was just having this conversation with friends a few days ago. We do still watch games, but we all used to also watch sports news/talk shows (e.g. morning pre-football coverage, SportsCenter, and the like) and most of us have stopped. Some of the shows are now exclusively focused on betting.

          I'm all for consenting adults to be able to legally place wagers at outlets that are not swindling them, or offering the kinds of loans that could get a person's legs broken.

          But I'm so tired of ALL THE COVERAGE being about betting. It was more fun when the coverage was mostly sports, and Al Michaels had to sneak in the odd mention of what the point spread was for a game he was broadcasting.

          Even my friends who enjoy gambling don't like the media coverage of it. I guess we're not a representative sample.

          • xp84 2 hours ago

            > Even my friends who enjoy gambling don't like the media coverage of it.

            You may well be representative; it’s just that all these parties directly invested in gambling would rather expand gambling as much and as fast as they can, at the expense of turning off their whole audience.

            • svachalek 43 minutes ago

              Much like politics, it's been decades since the coverage has had anything substantial to say about the issues or the candidates, it's all treated like a horse race now, who's gained or lost 1% in the polls.

          • nonethewiser 2 hours ago

            Yes this is exactly what I mean. Coverage of the sport has been replaced with coverage of the gambling games around the sport.

          • spike021 2 hours ago

            Honestly it's a lot like the alcohol ads being everywhere. I don't have a problem with drinking alcohol but this is supposed to be a sport enjoyed by the whole family, and there are broadcasts where the inning break is filled almost entirely with hard liquor advertisements. Even at the ballpark it's hard to avoid advertising for beer and other drinks.

        • spike021 2 hours ago

          in addition to what Jeremy said, some broadcasts even show the betting line or chances for certain things to happen as the inning is being played (like what are the chances a player hits into a double play or hits a home run, etc.) specifically for the betters.

      • subroutine 3 hours ago

        Unfortunately the future of sports media is ownership by parent companies that also own sports betting sites. The yearly revenue of the largest gambling sites in the US rivals the combine revenue of the MLB, NHL, NBA, and NFL, and some major sports coverage media outlets.

        Penn entertainment for example acquired Barstool Sports and The Score, and entered into a 10-year deal with ESPN to create ESPN-bet, for cash and a stake in the company. ESPN is now directly invested in the gambling industry.

      • basisword an hour ago

        It's interesting to watch as an international viewer. Sports gambling here has been legal forever and although we get betting company ads during commercial breaks (and some sponsorship stuff) the US has managed to legalise it and make it toxic almost instantly. Commentators and pundits should not be giving odds on air (with rare exceptions). Pundits shouldn't be giving 'their' betting picks. The problem isn't gambling - it's the excess to which it's been implemented.

        • spike021 24 minutes ago

          if there's anything Americans love, it's excess.

    • dfxm12 an hour ago

      I always thought the sharpest declines were around steroids and the 94 strike.

      https://news.gallup.com/poll/4735/sports.aspx

      The data shows that the biggest drop was around the 60s. This is probably due to TV. The strike looks like it had some effect and the steroids era not much.

      I think baseball needs more national stars. People like Ohtani and Judge, but they are not on the level Ken Griffey, Jr. was in 93-94. None of them reach the level of Mahomes or Manning either.

    • nonethewiser 3 hours ago

      I get why people say its boring but I love it as well. I don't follow it anymore really and if I tune in randomly I feel similarly - it seems boring. It just takes some exposure before you can appreciate it. The emergent narratives within games, series, and seasons is really special.

    • basisword an hour ago

      As an international fan of several US sports MLB are miles ahead on streaming. I can access every single game through their in-house streaming service. Live or on demand. I can pause, skip ahead in-between innings, choose TV or radio commentary. I can watch on my computer, TV, phone, web. They even had a cool experimental Vision Pro app. The NBA isn't too far behind these days. The NFL was good but they've started selling their own in-house streaming rights to national broadcasters internationally so I've went from their decent in-house service to a pretty terrible third-party one.

    • jen20 3 hours ago

      I for one wish it would go further. Despite being in Austin, I often can't watch the Astros - as if I'm going to drive a six hour round trip to go to every game otherwise - without subscribing to some channel which is inevitably only available with companies I don't want to do business with. I'd happily pay ~300/yr for a streaming subscription that gets me all those games though...

      • xp84 22 minutes ago

        Yeah the out-of-market-only rules of the national sports subscriptions is really goofy. I guess they’re trying to protect the Comcasts of the world who own a lot of those regional sports networks where the baseball games are shown, because they pay a lot for those deals and would probably refuse to pay as much if MLB let MLB.tv have them. But it still sucks.

      • ascagnel_ 2 hours ago

        Baseball's biggest issue is that their biggest teams are also co-owners of their cable channels (and were trailblazers in this, with the Yankees and the YES Network). They don't care if you go to the game, they want you to get a cable subscription that has your local RSN, ESPN, TBS, your local FOX affiliate, and FS1 so that you can watch your team play. And that's not including games that may wind up on streaming platforms.

        The post you replied to included this:

        > I read that part of baseball's decline from the premiere American sport was due to its outdated revenue model (strict reliance on ticket sales). The NFL in 80s really embraced TV and reached more fans and here we are. MLB has been recently way ahead of the curve on streaming (MLB.tv, AWS StatCast etc).

        I'm _hoping_ (although numbers don't seem to be showing it as a huge success as of yet) is that the Apple-MLS deal works well enough that other leagues are at least open to the idea of a no-blackout, all-inclusive package.

      • criddell 2 hours ago

        That's my biggest complaint as well. The MLB streaming service needs to have an everything tier. I understand that teams want to sell rights locally, but figure it out. Charge me whatever you need to charge me and share the revenue with the local team. Just make it easy for me to watch!

        I too live in Austin and I watched more Toronto Blue Jays, SF Giants, and LA Dodgers games than Rangers games this year.

      • reaperducer an hour ago

        I'd happily pay ~300/yr for a streaming subscription that gets me all those games though...

        If you can get along with audio only, Sirius has a subscription that includes every MLB game.

        • agiacalone 16 minutes ago

          AFAIK, the MLB.tv subscription includes full audio for every game, including in-market games.

          My understanding of the issue is that MLB sold off the TV rights to local games years ago to the RSN (Regional Sports Networks) and the contracts have yet to expire. Rumor has it that around 2028 or so, they will try to rein them back in.

          https://www.nytimes.com/athletic/5933299/2024/11/19/mlb-plan...

        • jen20 an hour ago

          Eh, I can just read the text for that, and Sirius is definitely in the company of those I don’t want to do business with!

  • naet 4 hours ago

    I love plaintextsports for baseball already. Baseball is a game that serializes to text very well (and radio) vs other sports. Bringing it to the terminal is cool too.

    • nonethewiser 3 hours ago

      Yeah Im just now realizing how the baseball scoring conventions are basically a DSL for a baseball game. There is a standardized way for expressing what happens in a game. I wonder if this has been leveraged in any interesting programs.

      here is an example inning:

      K | 6-3 | BB | 2B (RBI, R1-H) | F8

      • 72736379 3 hours ago

        There's a standardized way to express what is happening in the game too- you'll often hear on the radio and television broadcasts the play that just happened using numbered positions on the field. 1 is pitcher, 2 is catcher, 3 is first baseman, 4 is second, 5 is third, 6 is shortstop, etc. so you'll hear something like "6-4-3 double play" which means the ball was fielded by the shortstop (6), thrown to the second baseman (4) for the first out, then to the first baseman (3) for the second one.

        Makes it easy to visualize the game if listening on the radio.

        • hoistbypetard 2 hours ago

          When I coach my youth teams, I always list their positions by number. I derive some minor benefit from doing that, but I'm also hoping that by having them learn the position numbers, it will make it easier for them to enjoy audio broadcasts of baseball games. There's a special kind of fun in listening to those.

        • nonethewiser 2 hours ago

          I think we are saying the same thing. This is the same as scoring the game they are just saying it out loud. Maybe my example didnt pick the most illustrative details.

      • aidenn0 2 hours ago

        How do you differentiate a swinging strike-out from a looking strike-out when you can't turn the K upside down?

        • dmoy an hour ago

          By upside down you mean backwards, yea?

          So... ꓘ

          • aidenn0 38 minutes ago

            Yes it's a 180 degree rotation.

        • royskee an hour ago

          Unicode FTW: "𝼃"

  • joshmn 6 hours ago

    This is nice. MLB has a surprisingly nice API for accessing things like this.

    (I misinterpreted "watch" completely different (post history will reflect why))

    • throwaway314155 4 hours ago

      > I misinterpreted "watch" completely different

      (profile bio) > I’m Josh; from Minnesota

      Say no more.

    • fred_is_fred 4 hours ago

      Now that is an understatement.

  • vunderba 4 hours ago

    Neat. I always envision that fans of a particular sports franchise use these text descriptions to reconstruct the game in their minds in the same way that people who play blindfold chess [1] do.

    [1] https://en.wikipedia.org/wiki/Blindfold_chess

  • gregjw 21 minutes ago

    I wonder how easy it would be to adapt this to work for NPB/Japanese Baseball.

  • dang an hour ago

    Related:

    Playball: Watch MLB games from the comfort of your own terminal - https://news.ycombinator.com/item?id=37591070 - Sept 2023 (1 comment)

    Playball: Watch MLB games from the comfort of your own terminal - https://news.ycombinator.com/item?id=21653981 - Nov 2019 (42 comments)

  • axbolduc 2 hours ago

    For others interested in the space there are a couple of other MLB TUI programs out there.

    mlbt: https://github.com/mlb-rs/mlbt gomlb (self plug): https://github.com/AxBolduc/gomlb

    I also know of NBA CLI (https://github.com/dylantientcheu/nbacli) for the NBA but last I checked it was having issues with changes to the NBA API.

  • dredmorbius 3 hours ago

    "Your Web browser is Ronald Reagan."

    -- Neal Stephenson

    <https://www.azquotes.com/quote/783529>

    <https://hackneys.com/docs/in-the-beginning-was-the-command-l...> (PDF)

    (Play-by-play...)

  • stack_framer an hour ago

    Very cool. I may just cancel my Fubo subscription and switch to this (Fubo has the glitchiest, buggiest, slowest video player I've ever seen)!

  • alargemoose 3 hours ago

    This is great. I’m working on something similar for tracking college football games from the terminal. Right now it just shows a List of active games with minimal navigation. lots of great inspiration.

  • jackmu 4 hours ago

    this is so cool! was it hard building a tui? i see you're even using react in there

  • airstrike 4 hours ago

    This is both really awesome and a perfect explanation for why I find baseball so incredibly boring to watch

  • Anaminus 3 hours ago

    The lock file is 12 times larger than the entire source.

      git clone -q https://github.com/paaatrick/playball.git
      cd playball
      echo $(du -bs package-lock.json | cut -f1) / $(du -bs src | cut -f1) | bc -l
  • rootcage 2 hours ago

    How can we extend this to NFL or NBA?

    • ascagnel_ 2 hours ago

      Gridiron football would probably work well for something like this: each play has a line of scrimmage, yards gained or lost, and a summary of the play (eg: from their own 47 yard- line, QB#3 threw a lateral to RB#8 with 3:08 remaining in the third quarter and gained 2 yards and was brought down by DT#10). Most importantly, there are defined "plays" that run from snap to down, which means you can summarize it.

      NBA play would be very different and very difficult, because there are no defined plays, only possessions. It'd include relative locations on the floor (lane, 2pt area, 3pt area), list of players who touched the ball, and what the outcome was (2pt, 3pt, turnover, out-of-bounds, etc).

      • xrd an hour ago

        I think a browser extension could be used to pull the content from the live stats stream as a good starting point.

      • Slothrop99 2 hours ago

        They have this (with a slight delay) on NFL.com and ESPN. Not sure if there's a public API for it tho.

  • nonethewiser 3 hours ago

    This is very cool. I like it.

  • jimt1234 3 hours ago

    This is great! Thanks!

    Years ago, I wrote something based on this same premise, mostly just to experiment with Golang: https://github.com/jimt1234/mlbcli

  • grantseltzer 4 hours ago

    'Watch' isn't the correct word.

  • reaperducer an hour ago

    Would love to see this as a Telnet or SSH service so I don't have to install npm for something I might only use once.

    EDIT: Nevermind, I found one downthread: https://github.com/mlb-rs/mlbt

  • Covzire 4 hours ago

    That's awesome, now if it would integrate with Plex somehow...

  • CamperBob2 4 hours ago

    The obvious next step is to train a model to turn these detailed updates into realistic live-action video.

    Of course, the obvious step after that is for MLB to shit a brick and shut down the API.

    • altairprime 4 hours ago

      Perhaps not posting the “here’s how to destroy a nice thing” ideas, which makes them more widely known and thus more likely to be created by someone, would help reduce the incidences of “nice thing destroyed”. That next step towards destruction is never quite as obvious to everyone as you think. Sure, a few people have probably thought of it, but odds are they won’t do anything about it. Sharing them widely like this is like leading a flash mob to hold up lightning rods in a thunderstorm and saying “it would be such a shame if lightning struck one of us”.

    • k2enemy 3 hours ago

      It seems like MLB themselves have been experimenting with this. On their website, they have a feature called "gameday" that animates the game. For a while now they've had a 2d view, but now they also have a 3d view that you can switch to.

      It is buggy as hell, but neat that you can move around the field and watch player movement off the ball. But there are a ton of glitches, like players getting frozen or duplicated, batters, umps, and catchers getting swapped (funny to see the ump at bat), and mixups with mount visits. In time, I can imagine this as a great way to watch though. Especially for novice players and fans learning the game and trying to figure out things like who should back up which throws in which situations etc.

    • boomboomsubban 3 hours ago

      It would be neat to recreate early radio, where a broadcaster would get a play-by-play over the wire and then announce it as if watching it, complete with sound effects. It was one of Ronald Reagan's early jobs.

      • nonethewiser 3 hours ago

        That is an interesting idea. And that sounds quite doable.

        Not sure about TOS but would be a natural fit as a twitch channel.

    • vunderba 4 hours ago

      When I first read the description of this project I actually assumed that it was using ASCII in the terminal to recreate the current state of the game...

    • iancmceachern 2 hours ago

      "Just because you can, doesn't mean you should"

      - Everyone's favorite chaotician

    • RankingMember 4 hours ago

      > The obvious next step is to train a model to turn these detailed updates into realistic live-action video.

      Wasn't obvious to me- sounds like you've got an idea that might be fun to pursue.

    • intrikate 3 hours ago

      Why would they shit a brick over people using data to ask a computer to generate videos of... a game they already captured video of?

    • samrus 4 hours ago

      That video would be such slop. It wont be as fun as watching an actual pitch/hit.

      Also the fun baseball stuff, the kind jomboy covers, wont ever be in the video because its not in the feed