Kilg.us – Fantasy Stat Tracker …Tracker

A blog about the development of Kilg.us – The Fantasy Baseball Stat Tracker

Posts Tagged ‘add player’

Players Updated Again

Saturday, May 31st, 2008

I just ran the player-updater script again, so all the latest roster additions should now be in the system. New players include:

  • Jay Bruce
  • Andy Philips
  • Jeff Bailey
  • Grant Balfour
  • Scott Elarton
  • Mike Aviles
  • Jeff Larish
  • Joe Nelson
  • Russell Branyan
  • Clayton Kershaw
  • Terry Tiffee
  • Nick Evans
  • Brian Horwitz

Once I smarten-up, I’ll set that updater script to run nightly to make sure the player list is always up-to-date. Until then, I’ll just try to remember to run it manually. If you can’t find a player that you think should be listed, please let me know and I’ll try to get him pulled in.

Updated Player List

Friday, May 23rd, 2008

I’ve re-written how the Fantasy Stat Tracker is gathering its player list. Previously it was pulling data that was created before the season started. This left the application without a few dozen players and some players with incorrect information (players on the wrong teams or with incorrect positions). The application is now capable of pulling player data from daily game stats. This means that I can run the process to grab player data and have it pull in everything updated to the current day. Rookies and other new players will be added, and positions will be updated if they change.

In most fantasy leagues, as players play a new position they ALSO become available at that position rather than replacing their old position with the new one. Because the Fantasy Stat Tracker isn’t as much about your roster and league rules as it is about the stats for the players, I don’t see the behavior of replacing positions as being too troublesome. When I run out of things to work on, though, I’ll look into listing players with all their applicable positions.

Search for Players

Friday, May 23rd, 2008

I found a little time to work on the Fantasy Stat Tracker this morning and put it to use adding functionality to search through players when adding a player to your team. Previously the Add Player function offered a laundry list of every player in the application. By using your browser’s built-in search function it wasn’t too difficult to find the player you were looking for–but it wasn’t ideal. You can now search by first and/or last name as well as filter results by position. By default, the Add Player page still provides the laundry list, should that be an effective mechanism for you.

Player searches are performed via a Post back to the Add Player page, meaning a round-trip to the server each time you search. Filtering by position, though, is handled on the fly. For some reason, the first time you filter by a position the application takes a few seconds before updating the list. After the first round, though, it happens almost instantaneously.

I also fixed a bug that was introduced last week when I added links to the player detail pages on MLB.com. I had originally built the display to pop-up a JavaScript alert when you requested to Remove a player from your team. That alert read the content of the table cell holding the player’s name. After adding in the link to the MLB.com page, this caused the alert to display a string of HTML/JavaScript instead of just the player’s name. I updated it to look within the anchor element for the player’s name so the alert pops-up with just the player’s name again.

Sign Up Now!

Friday, May 9th, 2008

It is now possible to sign up for an account on the Fantasy Stat Tracker, build your team, and track your stats! I’ve finished the functionality just in the last few minutes, so there is A LOT of work yet to do–rough edges to smooth, data to validate, workflows to finesse. But…the basic functionality works! There is no warning if your email duplicates an existing one (it will fail silently and won’t create your account). It also isn’t checking whether user names exist already, so it’s possible to duplicate users. That means down the road I might flush the database to get rid of crap data. So, if you sign up now, I don’t promise I won’t erase your account as development continues. I’ll try not to, though.

I was able to create an account and build a 25-man roster in less than 5 minutes. Please, give it a shot, and let me know what you think. Please post comments on the Fantasy Stat Tracker back to this blog post.

Enjoy!

Roster Manipulation

Friday, May 9th, 2008

With the new flexible architecture, I made a lot of progress on the Fantasy Stat Tracker today. First at hand was to programatically populate the Players table in the database. This is handled with a pretty simple PHP script that I intend to schedule to run nightly on the server to ensure that as new players come into the league, they are available in the Stat Tracker. Just a few minutes ago as I was wrapping up for the night I realized, however, that the source I’m using to get the player list is out of date. I noticed this when trying to add Jesse Carlson to my team. He’s not listed as a player…and Frank Thomas is still listed as a member of the Blue Jays. Obviously I’ll need to look around for a better, up-to-date, player list.

Today I also built out the first drafts of adding players to, and removing from, a team roster. When viewing your team, each player has a red “X” alongside their stats. Clicking that icon opens a confirmation prompt and leads to removing the player from the team roster. Players are added by visiting a massive list of all players, then clicking on the player’s name. I’ll flesh out that interface to allow sorting of players (positions, names, leagues, teams) to make it easier to find the player you wish to add to your team.

Now that it’s possible to add players to a roster, it will be possible to build new teams, so I think my next task will be a workflow to create a new team. Following that will finally be the workflow to sign up for an account! Stay tuned! Soon you’ll be able to sign up to use the Fantasy Stat Tracker to follow your teams!