Results 1 to 10 of 37

Thread: HOWTO: MLB Baseball scores from the command line!

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Location
    Toronto
    Beans
    104
    Distro
    Ubuntu 13.04 Raring Ringtail

    Question HOWTO: MLB Baseball scores from the command line!

    I often want to check the baseball score without opening a browser. (That's right, it's too much work. And sometimes not appropriate at work, considering how much I check it.) So I wrote this very simple command line to fetch and parse the ESPN MLB scoreboard page.

    Here's some sample output

    Code:
    AMERICAN LEAGUE - GAME 1
       Top 5th
       Toronto (10-12, 5-5 away)
       Tampa Bay (10-11, 6-7 home)
       1 2 3 4 5 6 7 8 9
       0 0 2 0 0
       0 0 1 1
       R H E
       2 5 0
       2 3 0
       GameCast | Box Score | RealTime [in.gif] | Watch
       Balls: Strikes: Outs:
       Pitching: Sonnanstine (TAM) 4.1 IP, 2 ER, 3 K
       Batting: Inglett (TOR) 0-0
       Pitch 4: ball 3
    Here's the command line

    Note you will need Lynx (a non graphical browser)
    Code:
    sudo apt-get install lynx


    Code:
    lynx -nonumbers -dump http://scores.espn.go.com/mlb/scoreboard | egrep -i -A12 -B2 Toronto
    Replace Toronto with your city.


  2. #2
    Join Date
    Jan 2007
    Beans
    152
    Distro
    Ubuntu 11.04 Natty Narwhal

    Thumbs down Re: HOWTO: MLB Baseball scores from the command line!

    that's amazing nice work!

  3. #3
    Join Date
    Aug 2007
    Beans
    2,132

    Re: HOWTO: MLB Baseball scores from the command line!

    Thanks for this - I just had to put quotes around "St. Louis"

  4. #4
    Join Date
    Apr 2008
    Location
    /na/usa/ca
    Beans
    153

    Re: HOWTO: MLB Baseball scores from the command line!

    That is awesome. I need to add that to Conky. Thanks, man!

    EDIT: Hmm... how to auto-update it every few minutes... hmm...
    Last edited by elmer_42; April 25th, 2008 at 02:26 AM.
    archlinux \\ amd+ati \\ subtle \\ website

  5. #5
    Join Date
    Apr 2008
    Beans
    Hidden!

    Re: HOWTO: MLB Baseball scores from the command line!

    can you do one for the nhl? :/

  6. #6
    Join Date
    Apr 2007
    Location
    Toronto
    Beans
    104
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: HOWTO: MLB Baseball scores from the command line!

    Quote Originally Posted by SuperSon!c View Post
    can you do one for the nhl? :/
    Replace "MLB" with "NHL". You'll have to do a little playing around to get the output you like in the egrep parameter.

    Code:
    lynx -nonumbers -dump http://scores.espn.go.com/nhl/scoreboard | egrep -i -A12 -B2 Colorado
    You'll have to fix the output, but it should be easy,

  7. #7
    Join Date
    Apr 2008
    Beans
    Hidden!

    Re: HOWTO: MLB Baseball scores from the command line!

    you my friend, rock! thanks! atm i'm having problems getting anything from the repos, but will continue trying.

  8. #8
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: HOWTO: MLB Baseball scores from the command line!

    Old thread is old. Closed.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •