Update: The widget is fixed, download the new version here!
The AFL has recently changed the layout of their website, including the ladder page where the AFL Ladder Widget v1.4 (and all the earlier versions) downloads the ladder data from. Thanks to John Reed for letting me know. A fix is in the works and a new version will be available to download in the next day or two.
For those who want to know the technical details behind the problem, well the widget is simply downloading the entire ladder page from the AFL website and then parsing through the ladder page source code, looking for the ladder data, which is in a HTML table structure. Once it has found all the data, it is displayed on the front of the widget.
Every time the AFL changes thier website, the formatting of the ladder table changes and because the current algorithm the widget uses to find the ladder data isn’t fool proof, it will more than likely fail to locate it, giving the “Error with data” message. The AFL changing their web site is unavoidable, and it’s not possible to write a fool proof parsing algorithm, given that the AFL can change the site in any way they want at any time.
But I’ve already taken a look at the AFL’s new ladder page and to their credit, they’ve made it easier to parse for the ladder data by including new unique attributes along with the ladder table data elements which they previously didn’t have. So as long they don’t change these, parsing the ladder page should be simpler and more robust, until the next time the AFL makes a major change to their website.
Does anyone know of an XML feed from the AFL which provides this kind of data without all the formatting?? That’d make my life so much simpler…