Two bad things happened at the MLS website this week, at least with respect to SoccerPhone (it’s a program I wrote that you can use to hear live soccer scores over the telephone). One change is pure unadulterated evil, and the other could be good or evil depending on your aesthetics.
The first pure evil change was to change the URL for the live scores page. What the heck was wrong with /scores.html? I’m sure I’m not the only MLS fan who has that page bookmarked. The new URL is /MLS/scoreboard/index.jsp, or equivalently, /MLS/scoreboard/. While I’m very happy they have gone to a Java-based solution for their website (the performance is now much, much better and the generated HTML quite a bit cleaner), I wish they could have at least redirected scores.html to the appropriate JSP page. While this change also broke SoccerPhone, at least it required only a one line code change.
So how could they have avoided changing the URL that most people used?
One approach would have been to have put the original scores page at /scores/index.html. Then, when they upgraded their site to use JSPs, they could have set up their servlet engine to look for index.jsp in that same directory if someone requested the page http://www.mlsnet.com/scores/. The people who bookmarked http://www.mlsnet.com/scores/ instead of http://www.mlsnet.com/scores/index.html would have never noticed the change. Worst case, the webmaster could have always used Apache’s mod-rewrite module to redirect the requests. Looking at the HTTP headers (thanks to the cool Live HTTP Headers plug-in for Mozilla browsers), they seem to be using Sun ONE Web Server for at least part of the site, which I assume has at least the basic URL rewriting capabilities that would have been needed. Some of the files on the MLS website are coming from an Apache 1.3.26 server.
Another approach would have been to hide the file extension. I’ve read a bit about how to do this using Apache. That allows you to still use reasonable names for files, without the person browing your site having to know if the resources are implemented as static HTML, JSPs, PHP, CGI scripts, etc. The advantage of this approach over the previous one is that you don’t have to create as many directories.
The bigger change to the MLS website was to revamp the UI for the entire website, including the live scores page. That change completely broke SopccerPhone. I grab the team names, scores, etc. by parsing the HTML using regular expressions in a Python CGI script. The new HTML isn’t even remotely close to the old HTML.
I’ve now ported the code for grabbing the team names and the scores to deal with the new HTML layout. Fortunately, the live scores page has a control that lets you easily and quickly see scores from previous weeks. That, in and of itself, is awesome. I had wanted to enhance SoccerPhone so you cold retrieve previous weeks’ scores. The other reason it is cool is that I don’t have to wait until the games start tomorrow to do most of the work on grabbing the game time and the scoring details.