Live TXT Voting Results Site
The Pocatello 2013 July 4th Parade had a "People's Choice" Award for floats in the parade. The customer wanted the ability to allow people to vote for their favorite floats by sending the float ID (or multiple IDs) via TXT message. They also asked for the results to be displayed on a website when the voting was over. We decided to go a bit further and add responses to the TXT votes and display the results live, as they came in, on the website.
We needed a way to parse, store, and respond to TXT messages to make this interactive. We decided to use a TXT service that allowed a connection via a Jabber client. Then we found a Jabber PHP library so we could listen to the incoming TXT messages. Next was some message parsing code and a MySQL database to store the votes. After the messages were parsed and stored, we sent back a TXT message confirming their vote using the Jabber to TXT service.
There were a couple issues we had to work around. The TXT service we used throttled outgoing messages and did not queue additional messages sent once that limit is reached. There was also no way to test if the limit had been reached and no response from the service either. After some trial and error, we discovered the limit and built in a message queuing system to handle the outgoing TXT messages.
The customer also so needed the ability to start and stop the voting period. So we checked incoming TXT messages from certain cell numbers for special commands that started and stopped the voting results. This way they could control the voting period while they were at the parade.
The website was a fully responsive, AJAX reloading, live results page that updated as votes come in. It was built using Twitter Bootstrap and jQuery.