The Official Forum

The Official Forum (https://forum.officiating.com/)
-   Softball (https://forum.officiating.com/softball/)
-   -   If ASA won't do it... (https://forum.officiating.com/softball/49089-if-asa-wont-do.html)

NCASAUmp Wed Sep 24, 2008 09:33pm

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!

NCASAUmp Wed Sep 24, 2008 10:52pm

Never mind the "before the weekend" statement. It's already done. :)

IRISHMAFIA Thu Sep 25, 2008 07:20am

Quote:

Originally Posted by NCASAUmp (Post 539149)
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.

NCASAUmp Thu Sep 25, 2008 07:40am

Quote:

Originally Posted by IRISHMAFIA (Post 539169)
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.

Skahtboi Thu Sep 25, 2008 08:46am

Quote:

Originally Posted by NCASAUmp (Post 539175)
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. :D

NCASAUmp Thu Sep 25, 2008 09:14am

Quote:

Originally Posted by Skahtboi (Post 539190)
¡Mire! Puedo hablar otra lengua también. :D

¿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. :D

Skahtboi Thu Sep 25, 2008 11:03am

Quote:

Originally Posted by NCASAUmp (Post 539197)
¿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. :D

Yeah...but what about the one you were talking, the one in my last post about "solaris linux crontab" crap???

NCASAUmp Thu Sep 25, 2008 11:10am

Quote:

Originally Posted by Skahtboi (Post 539220)
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?"). ;)

CajunNewBlue Thu Sep 25, 2008 12:39pm

Quote:

Originally Posted by NCASAUmp (Post 539224)
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!!:D

IRISHMAFIA Thu Sep 25, 2008 01:15pm

Quote:

Originally Posted by NCASAUmp (Post 539197)
¿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. :D

Hey, some of us live in the US, not Texas!

whiskers_ump Thu Sep 25, 2008 01:19pm

Quote:

Originally Posted by IRISHMAFIA (Post 539270)
Hey, some of us live in the US, not Texas!


Yeah, but those not living in Texas, really wish that they did?:D

NCASAUmp Thu Sep 25, 2008 01:19pm

Quote:

Originally Posted by IRISHMAFIA (Post 539270)
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. ;)

IRISHMAFIA Thu Sep 25, 2008 01:21pm

Quote:

Originally Posted by NCASAUmp (Post 539274)
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!

NCASAUmp Thu Sep 25, 2008 01:33pm

Quote:

Originally Posted by IRISHMAFIA (Post 539277)
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.

NCASAUmp Thu Sep 25, 2008 01:37pm

Quote:

Originally Posted by CajunNewBlue (Post 539250)
lol and I thought i was a 'puter nerd.... Dude you rock!!:D

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?" :D


All times are GMT -5. The time now is 08:27am.



Search Engine Friendly URLs by vBSEO 3.3.0 RC1