Sunday, November 04, 2007

2007 Fantasy basketball script released

*update - 2/22/2008 - updated the script to handle new yahoo boxscores for in progress games

I couldn't sleep last night (Friday night...actually Sat at 2am to be exact) so I stayed up and implemented the two missing features for the live stats basketball script: maintaining the order of players in the modal window and displaying a summary of all active players' stats.

The first feature was easy to implement since I had already solved that problem for baseball. The old technique of adding a row after retrieving a player's stats leads to indeterminate ordering because we do not wait for a boxscore request to finish before moving on to the next. Therefore, it was possible that a UTIL player who is towards the bottom of the management page would actually be processed faster than a PG depending on how snappy the server handled the request. The solution is to create placeholder rows that have the correct order and then update those rows later.

The second feature is summarizing all your players' stats for the night. Unlike a baseball boxscore where a player's stats appear on multiple parts of the page and some stats need to be derived, all basketball stats appear on one row. That's why I didn't create full blown function objects that had getter/setters for stats like assists, turnovers, pts, boards, etc. Instead, I went the lightweight route and defined two rules that are used to summarize stats. If the stat has a dash, like 7-11, then we keep track of total made and total attempts, else we just sum up the current stat with the running total.

9 comments:

Brad said...

Great script; thanks for all the work you put into this.

Anonymous said...

yahoo changed their NBA scoreboard.kindly modify and update the script...thanks in advance

Farid said...

amazing script David!

Anonymous said...

this doesnt work. I'm using vista 64, and this does not work at all

Anonymous said...

I installed grease monkey and then clicked the install script icon. Do I have to do anything to activate it or will it just activate on its own?

Anonymous said...

i gotta tell you man, that's really good.

Thanks a lot

Wilson Ng said...

super cool! ingenius!
thanks a lot man

Alberto said...

viagra online
buy viagra
generic viagra

game sportswear said...

Thats a good one!