SoccerPhone Lives Again

By | February 2, 2003

After the Major League Soccer season ended last fall, I forked the code for SoccerPhone so I could work on a version that downloads the live scores from SoccerNet and reads them to you over the phone. This was a much bigger challenge than automating the MLS live scores page. I now had to deal with scores from multiple leagues, new abbreviations, non-ASCII characters for the Spanish teams in La Liga, etc. I managed to get it mostly working before I ran into a stumbling point. I think I recently figured out how to get past it, but at the time I got distracted by …

PhoneBlogger. Yes, work on PhoneBlogger consumed my bits of free time available for hacking over the last few months.

Yesterday afternoon, though, Sandra pointed out a thread on the BigSoccer forums about getting MLS scores on a cell phone. (Yes, I am Data ferret on Big Soccer. No, I don’t own a ferret. The name makes about as much sense as WombatNation, though I usually am pretty good at ferreting out data on the Internet.) So, I checked SoccerPhone out to make sure it was still working. MLS had tweaked a couple things on their site, so it was partially broken. I decided to go ahead and merge the code forks and clean up and extend my PyUnit tests. This afternoon I finally got everything working again, at least for the MLS page, and managed to write about 30 automated tests.

This experience confirmed for me again just how miserable it is to code JavaScript for VoiceXML applications. Now, I’m wishing I had written nearly all the dynamic code in Python and just fed back completely rendered VXML documents rather than returning XML documents and using JavaScript to parse them from a static VXML document. But, no, I thought I would make it more generic so the XML documents could be consumed by some other application, too. But, what?

The biggest problem, at least on the TellMe hosted service, is that you can’t step through your JavaScript code in a debugger while your app is running. You can’t even use print statement equivalents in the JavaScript code. You have to set a JavaScript variable with the value you want to see, drop out of the script, and then use a VXML log tag to print it to the call log. It’s really hideous.

Of course, I also can’t easily debug the Python CGI script when it is called from the VXML app, but I can easily simulate the VXML app when calling a CGI script, thus allowing me to write a comprehensive set of automated tests. While mixing JavaScript with VXML is really nice at times, it is very difficult to write automated test code that makes you confident that what you wrote will work.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.