Friday, March 13, 2009

Hack the vote: In-the-Moment Running Vote Tallies

It turns out the Javascript running the vote results' frame on NASA's site is flawed too.

Open the frame in its own page (or just click here) and open up the page's source code. Scroll about a quarter of the way through, and you'll see some lines of code which look like this:


var totalNumVotes = eval(totalOpinioVotes)+eval(totalCommentsCount) ;
document.getElementById('totalNumVotes').innerHTML = totalNumVotes + totalVotesText ;


If you play around a little bit in the Javascript, you'll discover that "totalOpinioVotes" is the number of votes for one of the given choices (Earthrise, Legacy, Serenity, Venture), and "totalCommentsCount" is the number of votes for a write-in suggestion. These numbers are great, but they're a little hard to find. To solve this, scroll a little farther down the page, and you'll see a link to http://polls.nasa.gov/opinio/ps?s=2253. If the page loads correctly in your browser (which won't be particularly happy, just so you know), you'll see a low-quality version of the poll and two boxes containing the two vote counts in the hundred thousands.

As I make this post, the numbers stand as 176257 votes for givens and 387731 votes for write-ins.

You know how NASA is setting up the poll so it looks like Serenity is way out in front with 3/4ths of the vote? It's almost certainly not. Serenity has 75% of 176257 or about 132193 votes. A write-in suggestion can beat that with 35% of the write-in votes.

-------------

A side note: I talked to Dr. Tyson this evening, and I asked him about the Node 3 effort. He responded by saying that he wished Colbert would mobilize his viewers more productively, like to lobby Congress for increased NASA funding.

[Disclaimer: THIS INFORMATION IS FOR EDUCATIONAL PURPOSES ONLY. Please don't actively try to ruin or tamper with the poll.]

No comments: