Live stats update

This is an open forum for anything related to the Dream Team Baseball League.

Live stats update

Postby Kevin » Tue Apr 19, 2016 3:56 pm

Many of you probably already noticed this, but this past weekend, I made some changes to the live stats pages and the behind the scenes gathering of information for said pages. Before I describe the changes, please allow me to rant for a minute.

MLB.TV is easily the best $100+ I spend every year. If I ever run into financial problems and have to make cutbacks, I'd probably stop eating before I'd give up MLB.TV. But the current version of their web media player (which was released mid-season last year) is garbage. It is worse than its predecessor in almost every way. Most notably, the fantasy player tracker is now pretty much useless. With the old player, I could watch a game on full screen on my TV via my HTPC and would receive pop-up notifications every time one of my tracked players was pitching, at bat, on deck or in the hole. This was an awesome feature because it allowed me to switch over to that game if I was so inclined, or perhaps pull up the game on another device. But the current player gives no such notices. The player tracker technically still exists, but it is not viewable when watching a game in full screen mode. The stats are buried a the bottom of the page, are often incorrect, and give no notification on players who may be coming up to bat or pitch. I figured they would fix this sooner than later. But here we are about ten months later and it still doesn't work.

With that in mind, I decided to take matters into my own hands and create my own player tracker. Enhancing the DTBL live stats pages seemed like the ideal solution, allowing those pages to be live player trackers not only for myself, but all of you as well if you are so inclined to use it as such. First of all, I changed the frequency in which the live stats are updated. Instead of every ten minutes, the data is now refreshed every minute. I may even knock this down to 30 seconds eventually if this seems to be running smoothly. Next, I added four new values that I'm retrieving from MLB's live game data: current batter, current pitcher, player on deck and player in the hole. I'm storing this info in my existing live game table.

Once I started pulling that information, I changed the live stats pages to search to see if any players on the roster being viewed are currently in one of those four states (at bat, pitching, on deck, in hole). If they are, the row will be highlighted with a color. So when you look at live stats page and see a player highlighed in blue, it means he is currently pitching. Green indicates players who are currently at bat. Yellow means on deck and orange indicates the player is in the hole. I don't know if we have any color-blind people in this league. If you are and are unable to distinguish these colors, please let me know and I'll gladly adjust the selected colors.

Finally, I updated the page so that it will automatically refresh every 30 seconds. So you don't really need to continually refresh the page to see the latest stats. I did this so you could conceivably leave a browser tab with that page open and check it to see your players' statuses, as well as live stats, any time you want. From my perspective, this is basically an improved version of MLB.TV's old player tracker, except for the fact that it doesn't actually let you watch the games. I hope you find these enhancements to be useful, but even if you don't, it was worth it just for me.

Let me know if you have any comments or questions.
User avatar
Kevin
Commissioner
 
Posts: 250
Joined: Fri Apr 04, 2003 3:58 pm
Location: Vienna, VA

Re: Live stats update

Postby Greg » Wed Apr 20, 2016 1:01 pm

I think it looks great and is a really nice feature. I keep the tab open at work and was actually about to make a suggestion for shortening the auto-refresh rate of the page. Then I saw the enhancements you made and, voila!, it's all finished.

Great work, I certainly find this very useful! And I also want to say thanks again for all your work on building and maintaining this site. I know it's an enjoyable hobby for you, but it still takes a lot of time and dedication to keep it running. I think I can speak for everyone in saying that it's hugely appreciated.
User avatar
Greg
Minor Leaguer
 
Posts: 25
Joined: Wed Apr 09, 2003 3:34 pm


Return to DTBL Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron