Election Day - RegionalPost's take
Yesterday was Election Day here in Portugal, crazy old Latin countries :) it's not hard to understand why we have so many soap operas and Reality shows, on the SIC Tv coverage they interrupted to report a hideous fumigating tropical storm coming our way (it won't :) , apparently the typhon wanna-be didn't make past the Madeira islands ;) ... tough place), but the rest was ... well, the usual stuff :) .
On the computer front however, things were set to take a different tone with ITIJ, STAPE and IBM teaming up to provide all those interested with a SOAP interface to the latest results, so that services might be built to pass out this information as they saw fit . Well, things WERE set to be different, unfortunately they weren't ... I don't exactly what went wrong, I had noticed unusual behaviour since Saturday, but I put it down on last minute testing and production environment setup. In the end, I don't believe the problem was the SOAP interface, I'm sure plenty of companies have much more complicated and crucial services depending on SOAP, and they're probably happy with it, so I won't go down that road, nor do I think practical to have a full database dump every 5 minutes to improve things, that would be lovely to scale to any mid sized country :D, in the end, I'm just sorry things didn't work, and I hope that when the next elections come, things will turn out ok.
Having said this, we (PT only, sorry :) , but don't loose faith, who knows where this is going? ;) ) decided to keep track of Setubal's results, and to accomplish that we would use the aforementioned webservices . Nothing too fancy, as time was of the essence (we heard about the webServices being available on Tuesday or Wednesday, and we all have paid work to do ;) ) , but something that might provide some usefulness to the people of Setúbal, as national television can't cover everything at the same time. So, our main ideas were :
- Depend as little on the webServices :)
- From the WSDL we drew up two database tables that would hold all the data we would need. We augmented it a bit to understand what sort of query had given "birth" to the data so that the extraction would be simplified. Also, we sort of feared things on the WebServices front might go wrong, so we had to cache things in some way, and what better way than by refactoring and augmenting the data to non-specific needs :D
- Make simple and independent steps
- We built a few scripts who's only job were to query the WS and collect the data on the database (thank you INSERT ... ON KEY UPDATE for keeping things simple ;) ), those scripts we're planed to go to a cron (AT for Win folk) job but we ended up running then by hand as we saw fit :D. We had a few scripts who would pull the data and generate a few graphs (thanks to JPGraph), while a web page would show html data tables and the graphs that we had (or not, depending on whether we had the data or not) generated.
- Provide users with simple means to use "our" data (or graphs) to put up on, say, their blogs
- We didn't :D , we're not sorry for it because of all the problems with the WebServices :) but will try to provide this sub-proxy-interface on our next elections :D (but it sounded good huh?)
In the end, we ended up waiting late for a specific part of Setúbal to finish up it's count so that a human-to-human text might be put up on the site :) and we failed miserably on providing a full blown Ajaxian interface filled with eye candy (ok, it was my secret plan :) ) BUT , for those of you who followed the count (at least me and my colleague did ;) ) it worked well, and we where happy to be a part of this and to provide some sort of service to our local community ;) (yes, we are local ;) )