Kilg.us – Fantasy Stat Tracker …Tracker

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

Archive for the ‘Features’ Category

Avatars

Monday, May 25th, 2009

I’m not in the mood to write tonight, so I’m going to be brief. Kilg.us now has avatars for Users and Teams. Hopefully this will make the dashboard easier to disgest at a glance. To define your User avatar, use the Account Information page. Team avatars are set via the Change Team Avatar link on the team page. All avatars are pre-defined images at this point, but flexibility will be coming soon.

Invite Your Friends!

Thursday, April 23rd, 2009

Now in year two, Kilg.us has seen significant growth. Since the start of the baseball season, membership has increased about 10-fold. Our community grew 6% just in the last day. With so much interest materializing, I was inspired to encourage further growth. To do so, I’ve added an “invite your friends” feature to the Dashboard and Find Owners pages. You can invite up to 5 friends at a time. All you have to do is enter their email address (preferably their name, too, but it isn’t required) and click “Send Invitations.”

There is some client-side validation to check for email address formats. I also included a quick check on the back-end to ensure you aren’t inviting someone who is already a Kilg.us user (based on email address). Right now the system doesn’t report back if you invite a current user–it just neglects to send them an email.

The invitation email that is sent includes a brief description of Kilg.us, an offer to sign up and join your (ie, the person sending the invitation) industry, and a list of links for more Kilg.us information. Last, but not least, there is a disclaimer at the bottom indicating who requested that the email be sent. This includes your name (if you’ve defined it in your Account Information) and email address.

So, go forth, invite your friends, and build your industries!

Track MLB Teams

Monday, April 6th, 2009

I’ve set up a “Major League Baseball” Owner that owns all 30 major league teams. If you would like to track stats of your favorite team (or any other team, for that matter), I would recommend you add this Owner to your Industry and use his rosters. I’ve written a script to update all the major league teams’ rosters will all the official data from MLB so you don’t need to constantly tweak a team you’ve personally defined.

One draw-back right now: when I pulled all the players onto their teams I found that MLB was publishing data for every player that was in spring training. So most teams have between 80-100 players on their stats pages. I’m looking into ways to fine-tune the rosters so they only show 25-man active rosters, or at least 40-man rosters.

If you would like to add Major League Baseball to your industry, but don’t want all 30 teams exposed to your User, shoot an email to mlb [at] kilg.us with your name/email and the teams you would like to be able to view. I’ll set the permissions for you.

Select Teams for Industry Members to View

Sunday, April 5th, 2009

Once an Owner has been added to your Industry, you can select which of your teams that Owner can view. This is done using the Team Permissions page.

Access the Team Permissions page for an Owner by clicking on that Owner’s name from your Dashboard in the Industry section. This will bring you to a page that lists all the teams you own, along with “Hide” and “View” radio buttons for each team. To make a team viewable by the industry member, select the View radio button for that team.

Once you have made your selections, click the “Assign View Permissions” button. This will save your team viewing assignments to Kilg.us and reload the page. After the page reloads, you should still see your assignments properly selected.

The next time your industry friend logs-in to Kilg.us, they’ll see your teams (the ones you selected for them to view) on their dashboard.

The Social Stat Tracker

Sunday, April 5th, 2009

Kilg.us is now the world’s first social stat tracker. This afternoon I finished up the basic functionality to allow the creation of “Industries” within Kilg.us. The underlying concept is to allow Users to track the stats of their friends’ and competitors’ teams.

The solution isn’t particularly elegant right now. I’ll be continuing to improve the interface and interactions in the coming weeks. Look for a future post to walk through how Industries work. For now, hop into your Account Info, add your personal details (name, hometown, cell phone), and opt into the public sharing so you and other Owners can start to build your Industry!

Two Days of Updates

Thursday, April 2nd, 2009

I quit working too late last night to post about the updates, so I’ll cover a couple days’ work now.

The biggest visible change was an update to the top site navigation. Previously, after logging-in, if you visited the home page or Tracker blog, there was no way to return to the system without logging-in again. Obviously, that was inconvenient. The home page and blog now both recognize an authenticated session and will display a new navigation link (that exists throughout the site now) to visit the Dashboard. This will get you back “into” Kilg.us without needing to log-in again.

The other big functional change is on the Add Player page. After receiving a report that adding a player was causing an alert in Firefox, I dug in to see what was happening. Unfortunately the alert was simply a slow script notice, not an actual error. What I ultimately determined was that the cumulative stat bubbles that I added the other day were causing an odd JQuery loop when the page is unloaded. Rather than trying to dig into JQuery to see what the problem was, I determined it could be alleviated by reducing the number of instances of the stat bubbles on the page. So the Add Player page now features pagination! Search results will be displayed 50 at a time with pagination links at the bottom of the page. This leads to quicker load times of the page, as well, so it seems like an improvement all-round.

Complicating the new Add Player pagination is the position filter. That filter literally filters down the players shown on the page, based on position.  All it really does is turn off the display of players that don’t match the filter. So, previously, changing the filter to a specific position would cause a display of all players at that position. Now, changing the filter will only show the players among the currently displayed 50 that match. This seems confusing to me, so I think I will need to re-write how it works.

On a non-visible vein, I’ve incorporated the functionality to allow Users to view other Users’ teams. This is a precursor to the social-stat-tracking concept I’ve been discussing. There is no interface to share your teams with other Users yet–the relationship has to be manually set in the database. There is a new relationship type, though. Originally a team only had one User related to it: the Owner who had total control to do anything with the team they wished. Now there is a Viewer User type. This User type can only view the team. They cannot change the team name, delete the team, add players, remove players, bench players, or change the team’s stats. I’m hoping to waste a good chunk of time this weekend working on social-stat-tracking. With a lot of luck, I’ll have something working by opening day.

On a reality-strikes front: the iPhone web app won’t be ready for opening day. Once life settles down a bit, I’ll try to get back to it later this Spring or Summer.

Add Player Stat Bubbles

Thursday, March 26th, 2009

A few refinement today centered around the live stats bubbles I implemented the other day. On the Team pages, I removed the title attribute from the massive tables on the page. Some browsers render that attribute as a tooltip when mousing over the element. With the introduction of the stat bubbles, this led to a lot more mouse-over, mouse-off, mouse-over actions which caused the tooltips to repeatedly redisplay. Perhaps a minor hit on accessibilty, but well worth it to remove the irritant for most users.
More substantially, I added the stats bubbles to the Add Player page. Now when you are looking for a player to add to your team, you’ll be able to reference his picture and season stats to help ensure you’re selecting the correct player. Throughout Kilg.us now, whenever you click on a player’s name, you’ll always get the same behavior: a stats bubble. Score one for usability!
On a global effort, I added some logic to the stat bubble code for batters to check if they have any at-bats by which to calculate their in-base percentage and slugging percentage. If the player has no at-bats, they will be given values of “.—” instead of the code throughing an error for trying to divide by zero.

In-Page Season Stats

Wednesday, March 25th, 2009

Per a User request today, I’ve added in season stats to the Team Stats pages. Previously, clicking on a player’s name would open a new window and take you to that player’s MLB.com detail page. Now when you click on a link, one of two things could happen.

  1. The preferred scenario: if you have JavaScript enabled, a bubble layer will appear that pulls in the player’s photo, name, link to their MLB.com detail page, and their total stats for the season.
  2. The alternate scenario: if you don’t have JavaScript enabled, you’ll be taken directly to the player’s MLB.com detail page.

As is always the case, I’m restricted by the stats that are coming from MLB.com. I added in crude calculations for OBP and SLG for batters, but those will only be approximations and may vary by a very slight margin from the official stats. All the other stats should be official and accurate.

The goal of this new functionality is to provide a little more perspective on each player’s overall performance without needing to head off to another site. It was also requested to include the player’s last 7 days of stats. As I discussed a few weeks ago, though, Kilg.us is intended to be a live stat-tracker. It isn’t an aggregating, collecting, statistical database. Nor is it a one-stop shop for managing your fantasy teams. For the same reasons I decided against allowing Users to view stats for any specific date (see the entries about box score emails), it isn’t possible to total stats over 7 day periods.

I was able to pull in the to-date season stats simply because they are easily available. They aren’t being stored in Kilg.us anywhere. Every time a layer is generated, a new AJAX request is made to the XML data sources to pull in the stats (and the player photo). Hopefully this will be a helpful compromise solution.

Account Information Additions

Thursday, March 5th, 2009

Lots of new items in the Account Information section. Kilg.us can now store some personal information like names, hometowns, and cell phones. Collection of this information is a precursor to the aforementioned team-sharing/social-networking features I plan to implement. I have included an option for whether or not to share publicly any personal information that is entered. The default setting for this is to hide any personal information. A User will need to explicitly turn it on for their information to be searchable or visible by other Users.

The Account Information page also now allows Users to sign up for daily stats emails for each of their teams. The test I mentioned yesterday fired off successfully, so hopefully it will work for everyone now. I’m very interested in any feedback on this feature. Please post a comment here or shoot me an email.

Daily Stats Emails

Tuesday, March 3rd, 2009

Today’s efforts again revolved around user feedback. The request was for the ability to select which day’s stats were viewed. Basically, the ability to dig back through yesterday’s stats…or the day’s before. I’ve been tossing this idea around in my head for a few days, negotiating with myself about how it could be handled. Ultimately, though, my conclusion was that it wouldn’t be. The purpose of Kilg.us is to be a free, live, baseball stat tracker. Being able to travel back through various days’ stats flies in the face of that basic concept (Not too mention, the entire basis of the code architecture). Also, trying to store stats for every day of a baseball season (or multiple baseball seasons) would start to get into scalability issues I don’t want to address.

That said, I understand the interest in being able to see yesterday’s stats; or the day before’s. So what I have implemented is a system to email your team’s stats to you. If you so choose, for any of your teams, Kilg.us will send you an email bright and early each morning with your team’s stats for the previous day. That way you’ll have your own, permanent record of your team’s stats over time, without Kilg.us needing to manage all that data. It seems like a win-win to me.

At this point, I have the script written that generates the email and fires it off and I have tested it for one of my teams. The next step is to schedule that script and ensure it is firing correctly each morning. I’m in the midst of that test now. Once I have confirmed it works, I’ll introduce an interface in Kilg.us that will allow all User’s to choose whether they want stats emailed to them for each of their teams. Hopefully that will be added sometime this week, so keep an eye out for it!