City Stadium Poll is Worthless

By Ryan McGreal
Published July 28, 2010

this blog entry has been updated

Earlier today, several observers noticed a strange phenomenon with respect to the City of Hamilton's Pan Am stadium survey. Specifically, the numbers moved overnight from 80% support for the West Harbour to 60/40 and then 50/50 support - but there were almost no pro-East Mountain comments on the comments page.

Curious about this, I decided to try and figure out how difficult it would be to bypass the website's user validation and submit multiple poll entries.

It turned out to be extremely easy - so easy that I must conclude the results are utterly worthless as an indicator of how Hamiltonians feel about the stadium location.

Please note: I'm not accusing the Ticats or anyone affiliated or associated with them of cheating. The survey is so simple to beat that anyone with even a modest knowledge of programming could do it. I wouldn't trust the numbers of either West Harbour or East Mountain supporters on the poll.

The Nitty-Gritty

I apologize in advance, as this section necessarily gets a bit technical.

Looking at the source code of the main Hamilton Pan Am Stadium page, the survey itself is contained within an inline frame on a page called poll.php. If you've already completed the survey, you should see a bar chart with the results (at 52/48 for the West Harbour as I write this). If you haven't completed the survey, you should see the survey form.

The form itself includes a simple javascript validation to ensure that the visitor has actually selected a location before submitting and contains an input field called "myVote". A value of 1 is a vote for the West Harbour and a value of 2 is a vote for the East Mountain.

It also has a couple of hidden fields: "action" and "ipAdd". The "action" field will have a value of "newuser" and the ipAdd field will have your IP address.

Once you select a location and submit the form, the poll.php page writes a cookie to your browser indicating that you've already filled in the form, so on subsequent visits you will see the results chart instead of the form.

The simplest way to get around this is simply to block all cookies in your browser and manually fill in the form multiple times - but that's tedious and any self-respecting programmer is far too lazy to execute repeated actions manually when they can be automated.

I decided to write a simple script that generates a random IP address and uses the handy cURL command line tool for executing multiple HTTP POST requests that each register as a legitimate vote. Because cURL doesn't use a browser to issue the page requests, the site never has a chance to install a cookie and block subsequent requests.

Interestingly, at the same time that I was writing and testing my code, the ratio of votes was swinging significantly back and forth as I refreshed the poll.php page in my browser, in a manner that had nothing to do with my activities. (Disclosure: I did enter some votes this way to prove that the method works, but I entered as many votes for the East Mountain as I entered for the West Harbour, so my own testing would not change the overall ratio of votes.)

How to Fix It

There are a few things the City could do to reduce the potential for this kind of abuse. Some combination of the following would eliminate casual gaming of the results:

Better yet, the city could scrap the web poll altogether, since even if every vote were legitimate, it would still not be a random, representative sample of Hamiltonians.

Update: as of the morning of July 29, the City has removed the poll from their website. In its place is the following message:

We have removed the poll due to ongoing abuse.

Please continue to post your comments.

Ryan McGreal, the editor of Raise the Hammer, lives in Hamilton with his family and works as a programmer, writer and consultant. Ryan volunteers with Hamilton Light Rail, a citizen group dedicated to bringing light rail transit to Hamilton. Ryan wrote a city affairs column in Hamilton Magazine, and several of his articles have been published in the Hamilton Spectator. His articles have also been published in The Walrus, HuffPost and Behind the Numbers. He maintains a personal website, has been known to share passing thoughts on Twitter and Facebook, and posts the occasional cat photo on Instagram.


View Comments: Nested | Flat

Read Comments

[ - ]

By rayfullerton (registered) | Posted July 28, 2010 at 22:09:47

Great troubleshooting re the City Web Poll. I agree the City Web Poll is useless! Hopefully the Terry Whitehead web poll can not be corrupted.

Permalink | Context

[ - ]

By UrbanRenaissance (registered) | Posted July 28, 2010 at 22:24:45

Smells like astroturfing to me.

Comment edited by UrbanRenaissance on 2010-07-28 21:25:01

Permalink | Context

[ - ]

By Jarod (registered) | Posted July 28, 2010 at 22:25:03

To be honest, sometimes I feel that these online polls, while interesting and a good conversation starter, are good for little else. I can't help but feel that they are placed simply to either increase site traffic for the poll hosting website, or to give an outlet for people to express how they feel without those truly responsible having to hear about it.

We all know these online polls have little statistical relevance, and it would appear, at least to me, that those supporting WH tend to leave a more educated comment (in general, I'm not saying those supporting the EM site are in any way less educated).

I guess, for me, the truly positive work (not to diminish any work done by others) is being done by those who email the city officials...constantly, those specific individuals scouring our city streets and uncovering some truly horrific things and shining light in areas that would otherwise remain dark.

And thank you Ryan for up-to-date articles and comments by you and others that really do help to formulate a well rounded understanding of why one site is better than the other, and how to explain that to others.

I'm sure there is more being done that isn't seen, but I guess what my final point is, these things and people are doing more good than any poll will.

Permalink | Context

[ - ]

By goin'downtown (registered) | Posted July 28, 2010 at 22:33:39

Jarod, how perfectly eloquent, and Ryan, good does one continually thank you for your continually amazing efforts. And Matt...and Graham...and...and...and...

Anyhoo, I do think those polls will be fodder for arguments so I suggest that we let our mayor and elected officials know what an inaccurate tool the City voting poll is at this time.

Permalink | Context

[ - ]

By barber (anonymous) | Posted July 28, 2010 at 22:58:22

Great sleuthing! Extra glad you used your powers for good instead of just tit-for-tat scheming.

Permalink | Context

[ - ]

By lawrence (registered) - website | Posted July 29, 2010 at 00:27:56

Wow. Awesome Ryan. Don't police stations give really good jobs to guys like you. lol That's amazing how you figured all that out/knew how to do that. It facinates me. I love though, how you made your little test fair. Speaks so much more about what RTH is about and what your campaign is about.

A;though I started my own little bid, I believe wholeheartedly in what you guys are trying to do. Including Jelly and his camera guy and others in this city trying to create change.

And yes, great reply Jarod

Comment edited by lawrence on 2010-07-28 23:28:44

Permalink | Context

[ - ]

By synxer (registered) | Posted July 30, 2010 at 09:36:57

@Jarod , @Ryan - I agree that polls are mostly baloney. The one line "do you think" captions polls generally have engage the passionate, knee jerk reactions.

Permalink | Context

View Comments: Nested | Flat

Post a Comment

You must be logged in to comment.

Events Calendar

There are no upcoming events right now.
Why not post one?

Recent Articles

Article Archives

Blog Archives

Site Tools