The Official Forum  

Go Back   The Official Forum > Softball
Register FAQ Community Calendar Today's Posts Search

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old Wed Sep 24, 2008, 09:33pm
Official Forum Member
 
Join Date: Apr 2007
Location: NC
Posts: 4,361
If ASA won't do it...

I sure as hell will. Guys, I'm tired of trying to remind myself to check the non-approved bats list, so I'm writing a script that will do it for me automatically. If the list changes, it will email me once to notify me. I should have it done before the weekend.

If anyone else wants to get in on the notifications, feel free to PM me your email address. I won't give your email address out to anyone.

If anyone wants the script itself, just let me know.

Yeah, I'm a geek, and yes, it was a slow day at work today!
__________________
Dave

I haven't decided if I should call it from the dugout or the outfield. Apparently, both have really great views!

Screw green, it ain't easy being blue!

I won't be coming here that much anymore. I might check in now and again.
Reply With Quote
  #2 (permalink)  
Old Wed Sep 24, 2008, 10:52pm
Official Forum Member
 
Join Date: Apr 2007
Location: NC
Posts: 4,361
Never mind the "before the weekend" statement. It's already done.
__________________
Dave

I haven't decided if I should call it from the dugout or the outfield. Apparently, both have really great views!

Screw green, it ain't easy being blue!

I won't be coming here that much anymore. I might check in now and again.
Reply With Quote
  #3 (permalink)  
Old Thu Sep 25, 2008, 07:20am
Official Forum Member
 
Join Date: Sep 2000
Location: USA
Posts: 14,565
Quote:
Originally Posted by NCASAUmp View Post
I sure as hell will. Guys, I'm tired of trying to remind myself to check the non-approved bats list, so I'm writing a script that will do it for me automatically. If the list changes, it will email me once to notify me. I should have it done before the weekend.

If anyone else wants to get in on the notifications, feel free to PM me your email address. I won't give your email address out to anyone.

If anyone wants the script itself, just let me know.

Yeah, I'm a geek, and yes, it was a slow day at work today!
I would like it, and did you ask ASA? If not, I will. They always love hearing from me.
Reply With Quote
  #4 (permalink)  
Old Thu Sep 25, 2008, 07:40am
Official Forum Member
 
Join Date: Apr 2007
Location: NC
Posts: 4,361
Quote:
Originally Posted by IRISHMAFIA View Post
I would like it, and did you ask ASA? If not, I will. They always love hearing from me.
I didn't ask ASA, because I initially started writing it for myself. Then I thought, "hey, wait... I know others on the forum have expressed interest in something like this, so why not open it up?"

All the script does is check the website once a day, search for a string (the "no changes since [date]"), and if it sees a change, it sends me an email. It consumes considerably less bandwidth than actually visiting the site, as it doesn't download any of the graphics. It also doesn't make any money, and it keeps the umpires (like myself) who actually care about enforcing the non-approved bat rule as informed and up-to-date as possible.

It basically works like this...
1 - It checks the website and puts the "no changes since [date]" into a little text file (THAT was a PITA to write, as the website uses JavaScript, and there's no way for you to go directly to the page that has the lists - I had to "curl" it and pass some -d flags to submit data, for you Unix geeks out there).
2 - It checks the new text file against the last text file it generated (when it previous found a change, or when it first ran).
3 - If there's a difference between the two files, it goes through another text file that contains email addresses (one address per line).
4 - If there's no difference between the two files, it simple deletes the new file, leaves the old file, and just exits.

I should also note that the script was written on a Mac, so to run, it will need to be on a Unix-based machine (like an out-of-the-box Mac, just about any Linux flavor, and possibly on a Solaris box as well). My advice is to simply stick it into a crontab, set to run once a day.
__________________
Dave

I haven't decided if I should call it from the dugout or the outfield. Apparently, both have really great views!

Screw green, it ain't easy being blue!

I won't be coming here that much anymore. I might check in now and again.
Reply With Quote
  #5 (permalink)  
Old Thu Sep 25, 2008, 08:46am
Official Forum Member
 
Join Date: Aug 2001
Location: Sherman, TX
Posts: 4,387
Quote:
Originally Posted by NCASAUmp View Post
I should also note that the script was written on a Mac, so to run, it will need to be on a Unix-based machine (like an out-of-the-box Mac, just about any Linux flavor, and possibly on a Solaris box as well). My advice is to simply stick it into a crontab, set to run once a day.
¡Mire! Puedo hablar otra lengua también.
__________________
Scott


It's a small world, but I wouldn't want to have to paint it.
Reply With Quote
  #6 (permalink)  
Old Thu Sep 25, 2008, 09:14am
Official Forum Member
 
Join Date: Apr 2007
Location: NC
Posts: 4,361
Quote:
Originally Posted by Skahtboi View Post
¡Mire! Puedo hablar otra lengua también.
¿En serio? ¡Yo también! Pero creo que ya sabes que mi esposa es de argentina.

Og jeg kan også snakke norsk. Jeg lærte det på universitetet i Wisconsin i Madison.
__________________
Dave

I haven't decided if I should call it from the dugout or the outfield. Apparently, both have really great views!

Screw green, it ain't easy being blue!

I won't be coming here that much anymore. I might check in now and again.
Reply With Quote
  #7 (permalink)  
Old Thu Sep 25, 2008, 11:03am
Official Forum Member
 
Join Date: Aug 2001
Location: Sherman, TX
Posts: 4,387
Quote:
Originally Posted by NCASAUmp View Post
¿En serio? ¡Yo también! Pero creo que ya sabes que mi esposa es de argentina.

Og jeg kan også snakke norsk. Jeg lærte det på universitetet i Wisconsin i Madison.
Yeah...but what about the one you were talking, the one in my last post about "solaris linux crontab" crap???
__________________
Scott


It's a small world, but I wouldn't want to have to paint it.
Reply With Quote
  #8 (permalink)  
Old Thu Sep 25, 2008, 11:10am
Official Forum Member
 
Join Date: Apr 2007
Location: NC
Posts: 4,361
Quote:
Originally Posted by Skahtboi View Post
Yeah...but what about the one you were talking, the one in my last post about "solaris linux crontab" crap???
Well, cron is a daemon that runs in the background on any Unix-base OS (such as Mac OS X, solaris, Linux, BSD, etc.), and all it does is kick off jobs that you set on a "crontab." The crontab says when exactly certain commands or scripts should be run, and on what schedule (such as "Every Monday, Wednesday and Friday at 12 PM").

So basically, I've set my web server at home (which happens to be a Mac server, as well as the server running the slow-pitch umpiring website I've mentioned before) to be the machine that periodically runs this script every day at noon. I'm going to have to modify the script a little to account for the fact that Time Warner probably wouldn't want me sending 20 emails of the same content to different recipients in under 5 seconds (spam? what's that?).

The script won't work on a Windows machine, as Windows doesn't use the same commands that Unix flavors do. It'd have about the same reaction to my script as Skahtboi did to my previous post (ie., "wtf?").
__________________
Dave

I haven't decided if I should call it from the dugout or the outfield. Apparently, both have really great views!

Screw green, it ain't easy being blue!

I won't be coming here that much anymore. I might check in now and again.
Reply With Quote
  #9 (permalink)  
Old Thu Sep 25, 2008, 12:39pm
Official Forum Member
 
Join Date: May 2007
Location: LA
Posts: 642
Talking

Quote:
Originally Posted by NCASAUmp View Post
Well, cron is a daemon that runs in the background on any Unix-base OS (such as Mac OS X, solaris, Linux, BSD, etc.), and all it does is kick off jobs that you set on a "crontab." The crontab says when exactly certain commands or scripts should be run, and on what schedule (such as "Every Monday, Wednesday and Friday at 12 PM").

So basically, I've set my web server at home (which happens to be a Mac server, as well as the server running the slow-pitch umpiring website I've mentioned before) to be the machine that periodically runs this script every day at noon. I'm going to have to modify the script a little to account for the fact that Time Warner probably wouldn't want me sending 20 emails of the same content to different recipients in under 5 seconds (spam? what's that?).

The script won't work on a Windows machine, as Windows doesn't use the same commands that Unix flavors do. It'd have about the same reaction to my script as Skahtboi did to my previous post (ie., "wtf?").


lol and I thought i was a 'puter nerd.... Dude you rock!!
__________________
Will Rogers must not have ever officiated in Louisiana.
Reply With Quote
  #10 (permalink)  
Old Thu Sep 25, 2008, 01:15pm
Official Forum Member
 
Join Date: Sep 2000
Location: USA
Posts: 14,565
Quote:
Originally Posted by NCASAUmp View Post
¿En serio? ¡Yo también! Pero creo que ya sabes que mi esposa es de argentina.

Og jeg kan også snakke norsk. Jeg lærte det på universitetet i Wisconsin i Madison.
Hey, some of us live in the US, not Texas!
Reply With Quote
  #11 (permalink)  
Old Thu Sep 25, 2008, 01:19pm
Official Forum Member
 
Join Date: Mar 2001
Location: woodville, tx
Posts: 3,156
Quote:
Originally Posted by IRISHMAFIA View Post
Hey, some of us live in the US, not Texas!

Yeah, but those not living in Texas, really wish that they did?
__________________
glen _______________________________
"Twenty years from now you will be more disappointed by the things
that you didn't do than by the ones you did do. So throw off the bowlines.
Sail away from the safe harbor. Catch the trade winds in your sails.
Explore. Dream. Discover."
--Mark Twain.
Reply With Quote
  #12 (permalink)  
Old Thu Sep 25, 2008, 01:19pm
Official Forum Member
 
Join Date: Apr 2007
Location: NC
Posts: 4,361
Quote:
Originally Posted by IRISHMAFIA View Post
Hey, some of us live in the US, not Texas!
That's why I stuck in a little Scandinavian for yas.

More specifically, Norwegian. Can't get much whiter than that, whitey.
__________________
Dave

I haven't decided if I should call it from the dugout or the outfield. Apparently, both have really great views!

Screw green, it ain't easy being blue!

I won't be coming here that much anymore. I might check in now and again.
Reply With Quote
  #13 (permalink)  
Old Thu Sep 25, 2008, 01:21pm
Official Forum Member
 
Join Date: Sep 2000
Location: USA
Posts: 14,565
Quote:
Originally Posted by NCASAUmp View Post
More specifically, Norwegian. Can't get much whiter than that, whitey.
You've never seen my very white Irish-American sister. If she ever fell down in the snow, we wouldn't find her until the spring!
Reply With Quote
  #14 (permalink)  
Old Thu Sep 25, 2008, 01:33pm
Official Forum Member
 
Join Date: Apr 2007
Location: NC
Posts: 4,361
Quote:
Originally Posted by IRISHMAFIA View Post
You've never seen my very white Irish-American sister. If she ever fell down in the snow, we wouldn't find her until the spring!
Ahhh... That must be how they do it in South Boston.

Anyway, I started to post a link to the script on here, but decided that would be a bad idea. I think if anyone wants the script itself, just PM me. A bit safer that way, because I can see how ASA might get rubbed the wrong way if I just freely distribute it without any caution.
__________________
Dave

I haven't decided if I should call it from the dugout or the outfield. Apparently, both have really great views!

Screw green, it ain't easy being blue!

I won't be coming here that much anymore. I might check in now and again.
Reply With Quote
  #15 (permalink)  
Old Thu Sep 25, 2008, 01:37pm
Official Forum Member
 
Join Date: Apr 2007
Location: NC
Posts: 4,361
Quote:
Originally Posted by CajunNewBlue View Post
lol and I thought i was a 'puter nerd.... Dude you rock!!
There are plenty of guys/gals who are WAY beyond me when it comes to being a computer nerd. I once put "if you can read this, you're a geek" into an ASCII-to-binary translator, and wrote it on the white board at my old job. My old boss walked by, stood in front of it for a moment, then turned to me and said, "what's wrong with being a geek?"

And by the way, it looked like this:

01001001 01100110 00100000 01111001 01101111 01110101 00100000 01100011 01100001 01101110 00100000 01110010 01100101 01100001 01100100 00100000 01110100 01101000 01101001 01110011 00101100 00100000 01111001 01101111 01110101 00100111 01110010 01100101 00100000 01100001 00100000 01100111 01100101 01100101 01101011 00001101 00001010

Wow.

Although my joke at work is "why work when you can script?"
__________________
Dave

I haven't decided if I should call it from the dugout or the outfield. Apparently, both have really great views!

Screw green, it ain't easy being blue!

I won't be coming here that much anymore. I might check in now and again.
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:25pm.



Search Engine Friendly URLs by vBSEO 3.3.0 RC1