RotoGuru Hockey Forum

View the Forum Registry


0 Subject: SWP CALCULATOR!!! - It's Here (Sort of)

Posted by: KrazyKoalaBears
- [5311571721] Sun, Dec 17, 22:09

Gleem.com Hockey SWP Calculator

It's a "Beta Version" right now, so don't knock it. Added features such as Sort by Name and Sort by Pos and Sort by SWP will come soon. Also, a nice page layout will follow. ;)

So basically I decided that I had finally gotten tired of calculating my SWP by hand or waiting until the morning to see if SW had updated them yet, so I made a Hockey SWP calculator.

It won't be able to take into account GWG, GTG, OTG, PPG, and SHG because the extra programming, processing, and downloading time just isn't worth it in my mind (for now) because I would have to open an entirely new set of pages which would double everything as is. So basically, the SWP you will see are a minimum number of points and you can tack on any extra points if you know the player got any of the above.

The SWP calculator also won't have Goalie SWP yet because I can't find a page that puts the stats in a nice little table like the rest of the players. I'm still looking though.

Enjoy it for now!

1hoops boy
      ID: 51440922
      Sun, Dec 17, 23:38
hey kkb, i got errors when clicking the link regarding File("http://...@MIN.htm") on line 8
2KrazyKoalaBears
      ID: 5311571721
      Mon, Dec 18, 06:04
I figured I would run into problems with this, but wasn't sure. The problem is that the boxscore I'm using is still listing "today's" games (according to the URL) as yesterday's games and when I try to add the date into the URL's that are created to get the boxscores, the code is actually using today's date (the 18th) instead of the intended date (17th). Ugh, more coding.
3hoops boy
      ID: 51440922
      Mon, Dec 18, 08:04
heh :-) let me know if you need help, im thinking just use time() to generate a current timestamp then subtract it by 86400 (# seconds in one day) and you have yesterdays date.
4KrazyKoalaBears
      ID: 2611391416
      Mon, Dec 18, 09:22
Layman's Terms: It's working again!

hoops boy Terms: hoops boy, we're going to have to get together on some PHP. ;)

Since the boxscores update after 12-noon, I used the following and it works nice!

$noon = gmdate(H);
if ($noon < 17){
$day = date(d, (time() - 86400));
}

This way, it only subtracts a day if it's before noon EST (based on GMT) and will work "normal" if it's after noon. Now I get to see what happens after noon when there are no stats to process and figure out how to handle that. Shouldn't be too hard (just check for an empty variable), but you never know.

5hoops boy
      ID: 16937178
      Mon, Dec 18, 09:54
hmm... heres an idea if you feel up to hacking some javascript. you could add a checkbox next to each name than when checked added that players points into a total field, to find total points gained that evening. Helpfull for the truely lazy sports fan!
6KrazyKoalaBears
      ID: 2611391416
      Mon, Dec 18, 09:56
hoops boy, I'm 2 steps ahead of you (for now). I remember RSF doing the same thing in the baseball forum this last season and everyone really liked it, so I think I'll do the same thing. It's not all that much extra coding anyhow.
7KrazyKoalaBears
      ID: 2611391416
      Mon, Dec 18, 13:03
Ran into a small problem with the switchover, but added a check to see if the url exists using @file($url)

It's now setup to read "No Games Have Started" until games have started... I hope. ;)

The "big" test will be tonight, so we'll see how it goes.

8KrazyKoalaBears
      ID: 5311571721
      Mon, Dec 18, 21:55
Well, after sorting through some errors (including dealing with GMT and other issues), the Hockey SWP Calculator should be working correctly now.

Hockey SWP Calculator

Enjoy, and look for more improvements to come!

9KrazyKoalaBears
      ID: 5311571721
      Tue, Dec 19, 15:39
I've added in the code to make the stats sort in Alphabetical order according to last name. I'm still working on the actual "calculator" part where you can select your players and have it automatically calculate, but be happy with what you've got!!! ;)
RotoGuru Hockey Forum

View the Forum Registry




Post a reply to this message: (But first, how about checking out this sponsor?)

Name:
Email:
Message:
Ignore line feeds? no (typical)   yes (for HTML table input)


Viewing statistics for this thread
Period# Views# Users
Last hour11
Last 24 hours22
Last 7 days33
Last 30 days55
Since Mar 1, 2007679354