16

MLB Standings Geeklet

Posted in Internet by jalvani 330 days ago

Guys, MLB Opening day is two (!!) days away. To get in the spirit, I threw together a geeklet and .sh script that pulls the standings for your favorite team's division, and displays them in a tidy chart! 

Screenshot

The Geeklet will curl your team's homepage (Line 1: you'll have to replace the Baltimore homepage with the team of your choice), then uses SED to parse for the right section and clean up the chart, and saves the output to a text file in /tmp/. It then displays the file using more, and pipes the output to the .sh script. You'll need to drop the .sh script in /usr/local/bin/. 

For more info, see my website.

Update: Uploaded a fresh version of the geeklet because I made a dumb mistake. Fixed. (thanks, Dylan!)

Geeklet files to download

Comments

User Avatar
jbartucca 324 days ago
Having some trouble with this. Never used Geektool before but would really like this to work. I am pretty sure the probem i am running into is where to save the script file. How do i get to the /usr/local/bin/ directory? Is it a hidden folder and I'm just an idiot? Or can the script be saved anywhere as long as the full directory is written in to geek tool?
User Avatar
jalvani 323 days ago
It *is* a hidden folder! Breathe a sigh of relief, friend. You're no idiot!

To put the file in /usr/local/bin/, do the following<

1. Open a new Finder window

2. Press Command+Shift+G to get the "Go to Folder..." drop-down

3. Type "/usr/local/bin/" into the field, and click "Go".

4. Copy the mlbstandings.sh script into the folder (You'll probably have to authenticate as an administrator). 

Yes, the script can be saved anywhere, but /usr/local/bin/ is where a user's specific executables go, dating back to Unix days. It's the best place for it.  Let me know if this works for you.
User Avatar
jbartucca 323 days ago
Okay, I found the usr folder. I can go through to local, but there is no "bin" folder, only a "lib". I am on version 10.6.7 if that makes a difference. But i did put the script on the desktop then change the directory within the geektool itself. It just showed an empty box. 
User Avatar
jalvani 323 days ago
See my response, above. If there's no bin/ in /usr/local/ you should be fine to create it. It likely just means that you haven't installed anything that had created it, yet.
User Avatar
samurai26 322 days ago
Errr, having problems installing this Geeklet

I've tried the solutions posted above, but nothing seems to work, all I get is a transparent empty box...If it helps, I'm trying to get this working for my Yankees :)
User Avatar
lad13 321 days ago
Same problem. I am trying to get it to work for the O's, but all I get is a blank box. mlbstandings.sh is where it is supposed to be and all of the scripts are correct. Nada! Any suggestions? Thanks!!
User Avatar
jalvani 321 days ago
@samurai26, @lad13: Guys, check [this link](http://blog.jehanalvani.com/post/4414925513/cannot-get-the-geeklet-to-work-i-am-trying-to-get-it). I posted a response that should apply to both of you. If you can run the two commands I posted and shoot me the results, I'll see if I can help you out. I'm betting it's a permissions issue.
User Avatar
rmaddre 320 days ago
How do you fix a permissions issue?
User Avatar
jalvani 319 days ago
For some reason, the site isn't letting me update the description, so for the time being, I'll put the update down here:

Some Text Editors aren't smart enough to set the .sh permissions correctly when saving the file. If you receive a permissions error when you run the command:

more /tmp/standings.txt | /usr/local/bin/mlbstandings.sh

The fix is likely the following command:

sudo chmod 755 /usr/local/bin/mlbstandings.sh

You have to be an administrator on the computer to run the command, and you'll be prompted for your password, but it should resolve the issue.
User Avatar
jalvani 153 days ago
Uploaded a new version of the geeklet (.glet) after seeing that MLB's indication of the division winners broke my script. Info [here](http://blog.jehanalvani.com/post/10518191797/yankees-win-the-al-east).

Log in to comment or register here.