Kilg.us – Fantasy Stat Tracker …Tracker

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

Posts Tagged ‘search’

Find Friends

Tuesday, May 11th, 2010

I jumped into the Find Friends section of Kilg.us this evening, planning to update the logic to auto-accept all friend requests to “Major League Baseball” (at present, I manually check the account daily and accept requests). Hitting the page, though, I encountered a Lucene search error, so that derailed my attention.

It looks like the search logic was getting confused when the page was sent an empty query (just clicking the “Find Friends” link rather than using the form on the Dashboard). This wasn’t happening a month or so ago when I set it up, so I’m guessing it has something to do with the size of the index that is being queried now.

Anyway, I updated the code to handle empty queries more gracefully. While testing that, I noticed an issue when requesting Friends that don’t have a name on their profile. When making the request, the prompt would ask if you wanted to request ” ” to be your friend. That isn’t very helpful. I updated that script to pull in the user’s email address if a name isn’t on the profile. Now when you ask someone to be your friend, you will either be prompted with their name or their email address. Much better.

In the process, my JavaScript errored out a couple times. This, unfortunately, means I requested to be friends with a couple people I don’t know. So if you got a random friend request from me, I won’t be offended if you decline!

Indexing Users

Saturday, April 3rd, 2010

Earlier this Spring I changed the search function for finding friends and creating Industries. The biggest change was moving to a system that uses the Lucene search engine. Part of that engine requires that an index be built for the data to be searched. This was my first implementation of Lucene, so I didn’t have experience with maintaining that index of data. As it turns out, each time the data within the database changes, the index needs to be rebuilt to include all the correct information.

Initially, I wrote a short script to build the index. As more and more people signed-up for Kilg.us, though, the data became out of date because it wasn’t automatically re-indexing.

I have updated the processes for creating an account and changing user settings to display information publicly. Both processes now include a step that re-indexes user data. This should ensure that the user index is always up-to-date and all users with their information shared will be findable in the Find Friends search.

Goings-on

Friday, March 26th, 2010

I haven’t posted about any Kilg.us changes for a couple days, but there has been a little going on. In my defense, I started a “Road to the Show” career in MLB 2010 The Show, so I MIGHT have been spending a little more time honing by batting skills than publishing about Kilg.us changes.

On the fixes side, there were some issues around gathering players and adding them to Kilg.us. Those have been revised now, so any player on a 40-man roster should be showing up (and then some). If you don’t see someone that you want on your team, post a comment or let me know.

There is an outstanding issue with rookies, though. I think I’ve narrowed it to the stored procedure that saves player stats, but all rookie pitchers show a blank (no zeros, no stats, completely blank) stat line regardless of their performance. This is next on the list of things to fix.

Next up, when players were being collected from MLB.com, they were added to the official “Major League Baseball” owner’s teams if they didn’t currently exist on the appropriate roster. They weren’t, however, being removed from their previous team if they had been traded or were a free agent (rather than a rookie). This never seemed to come up last year, but there code I changed to fix the problem hasn’t been touched in nearly a year, so I’m not quite sure the root of the problem. Hopefully it is resolved going forward.

On that note, keep in mind that you can follow any MLB team’s stats by adding the owner “Major League Baseball” to your friends. That particular owner has all 30 teams with rosters that are automatically updated to have all the latest players.

Among new features for 2010, there are three more items I hope to get out by opening day (or very shortly thereafter):

  1. Apply the new theme to the …Tracker blog
  2. Implement Lucene for Add Player searches
  3. Create a Season-to-date view of a team’s stats (cumulative for the season, not respective of adds/removals during the year; this was a request from a Strat-o-matic owner–hopefully others will find use in it)

Opening Day is barely a week away!

Add Players to your Team

Wednesday, March 17th, 2010

Players are added and removed individually from each of your teams. Kilg.us doesn’t try to enforce any specific league rules for when players can be added or removed from teams. You can do so at any time.

Find a Player

To find a player to add to your roster, you must first navigate to your team page. Across just below your team’s name there is a series of links including “Add Player”. Clicking this link will take you to the page to search for and add a player.

On the Add Player screen you will see a group of search fields in the right column. As their labels describe, you can search for players based on first name, last name, and position.

Kilg.us doesn’t use Lucene search for player searching yet (it does for friend searching), but this functionality will be added later in 2010.

Add Player page with result for a search on "Young"

Add Player page with result for a search on "Young"

All of the search fields you direct string matches. This means they will find sub-strings within longer names, but won’t find variations on the terms you entered. So, a last-name search for “you” will return “Young” and “Youkilis” but not “Lyon”. If your search doesn’t return the player you were expecting, trying using a shorter string of characters.

Review a Player’s Stats

After you have some search results returned, you can check out the stats of the players in the list. Clicking on a player’s name will open a layer that shows the player’s picture, total season stats, and a link to the player’s MLB.com profile page.

Add Player page displaying Michael Young player layer

Add Player page displaying Michael Young player layer

Add a Player

To add a player to your team, click on the green “plus” sign (+) next to his name. This will bring up a prompt to confirm that you wish to add the player to your team. If you accept, the player will be added to your team. This is handled by an AJAX request which means the page won’t need to reload. A new prompt will appear once the player has been added.

You can add as many players to your team as you would like in this session.

Activating your Player

After being added to your team, your new player will be placed on your bench. This means his stats won’t be counted when your team’s stats are calculated. To activate the player, click the gray-bars handle to the left of the player’s name on your team page and drag him above the “Bench” bar. To return him to the bench, just drag and drop him below the “Bench” bar.

Players riding the pine on a Team page

Players riding the pine on a Team page

Remove a Player

If you have added a player to your team accidentally or just want to remove someone, you can do so at any time. On your team page, there is a red “X” icon on the right end of each player’s stat line. Clicking this icon will prompt you to confirm that you wish to remove the player from the team. If you confirm, the page will reload and the player will be removed.

You can always add a player back to your team by using the same process described above for adding a player.

Bits and Pieces

Tuesday, May 12th, 2009

Updates to Kilg.us today:

  • Boxscore emails tomorrow morning should include team statistical totals.
  • Find Industry Members results page now identifies owners with a “pending” status (you can’t re-request an Industry now).
  • Add Players default state is updated so it lists all players instead of pulling in a seemingly random player.
  • Dashboard -> Industry “What’s This” link now opens a modal layer describing Industries and providing a link to the Tracker “social-networking” page instead of linking directly to that page.
  • Create Team and Change Team Name flows now encourage a 3 character minimum team name.

I’ll be out of town most of the next two weeks, so there probably won’t be many–if any–Kilg.us updates until late May.

How Industries Work

Sunday, April 5th, 2009

Each User in Kilg.us can create an Industry. An Industry is a collection of other Owners whose teams the User can potentially view and who can potentially view the User’s teams. Industry members cannot edit or change one another’s teams in any way–they can only view them. All team management functionality remains the sole rhealm of the team’s Owner (the User who originally created the team).

To build an Industry, a User must search for other Owners and add them to his/her Industry. Before an Owner is added to another User’s Industry, the Owner must approve the addition.

Once Owners are associated through one-another’s Industries, the Owners can select which of their teams they wish to share with the other Owner. These viewing rights can be changed at any time by the User that owns the team.

All management of a User’s Industry is performed via the Dashboard: searching for and adding Owners, accessing other Owners teams, and changing viewing rights for teams.

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.