Today, like most Fall Sunday's, is a great day to watch Football. It was fun watching San Fransisco play, but I often hack around on the computer during games. Fortunately there is plenty of time between commercials and time-outs to work on code. I wondered how hard it would be to pull football scores into a dynamic usebar. Surprisingly, it wasn't as hard as I thought it would be.
First off, I had to find an API. I ran across this Accidental APIs: NFL edition article that linked to some open JSON API. I decided which API would fit the bill and started to program. Since I use Perl, I updated my CPAN library with the latest version of JSON routines and parsed out the games, progress, and scores. After figuring out some image libraries to pull from, it was only a matter of updating my scripts to display the information as a animated GIF. I did have to tweak my libraries a bit to display two images. I think the end results came out better than expected.
Put in image or BBCODE tag: http://3v.reids4fun.com/football.cgi
I do need to put some effort into a better background image. I did accomplished my goal of displaying the scores. That is all that matters, for now.