The Polls Are In

Mike Industries Poll

What is your favorite feature to be added to Mike Industries in the last year?

I’ve wanted to add polls to this site for quite awhile now but never had the time to write a good voting component. Sure, there are some pre-made ones out there ripe for stealing but I wanted something fast, compact, flexible, and standards-based. Something I could just insert into any blog entry at any time to allow voting.

As luck would have it, we need polls at our new company, and so we busted one out. Several things like visual effects and more flexibility still need to be added, but I figured I’d let it loose for some early testing. Please make your selection on the right and post any suggestions or bug reports in the comments.

A couple of notes: You can only vote once. This is controlled via a combination of IP checking and cookies. The poll should work in all browsers, but we haven’t tested the obscure ones yet, so no guarantees at this early alpha stage.

The next thing on the plate is to add auto-updating, so for high-volume polls (certain not any on this here little popsicle-stand-of-a-site) you will be able to watch the results change on the fly.

Like this entry? You probably shouldn't follow me on Twitter here. I recommend the RSS feed instead.

45 Responses:

  1. Tom says:

    I’ll go ahead and be an ass. :) You should try considering other methods for polling on the mobile version, instead of AJAX ;)

  2. Mike D. says:

    Tom: Definitely. The poll should work with or without Javascript. The only thing javascript should do is intercept the form event if it’s possible to (viz. *not* on mobile devices).

  3. Tom says:

    Anyway, I love it. Never liked any “poll” links where little pop-ups showed up. I love the idea of inside-of-blog-entry poll system. Very neat.

  4. Chris R says:

    There you go again with the “New Company” thing…

    WHAT IS IT!!!!!!!!!!!!

    * nice poll BTW *

  5. miko says:

    Mike, I can vote twice: One in Safari, and another in Firefox.

  6. Yep, just gotta switch to a different browser and it’ll let you vote again. Cool integration of AJAX though.

  7. Scott says:

    Cool little script, Mike. I bet it will be swiped and made into a plugin for the big blogging apps in no time. Maybe you should post direct links to the files so it seems less seedy when it happens. :)

  8. Nice poll system indeed. Simple, compact, easy to use (it seems) — very nice. :-)

  9. Brian says:

    I was able to vote twice with Safari. I first voted on this page then hit my back button and was able to vote on the home page. Very nice though. I’m going to have to figure what this AJAX thing is all about.

  10. Mike D. says:

    Guys: With regards to the voting twice thing — If you don’t have the cookie (like if you switch browsers, for instance), you will see the questions again… however, once you submit your vote, your IP address will be checked and your vote won’t count. That is… if everything’s working correctly. :)

  11. Tom says:

    I don’t quite understand what you mean by IP address check. What if the dynamically assigned IP address expires from one client that has already voted, and assigned to another person, according to the logic, the person who got assigned the particular ip address can’t vote.

  12. Mike D. says:

    Tom: Yes… IP addresses can expire, but that’s the best spam-proofing you can do without requiring true registration/authentication (something which would probably be excessive for a poll).

    What you are saying is correct though. I’m just trying to prevent people from easily being able to spam the system.

  13. Ben says:

    What about an option for ‘None of the above’? ;-p

    And by the way, currently your sidebar is empty in Deer Park Alpha 2, you might want to look into the reason for that…

    (Editor’s Note: I’ve seen a lot of weird stuff on a lot of sites with Deer Park. Not worried at this point as they obviously have some things to work out. But many thanks for the heads-up.)

  14. miko says:

    Other than the IP, what else can you really use for checking?
    For instance, on a public computer at an internet Café two different users might go to the same site — let’s say one already voted, now the second can’t because of the same IP.

    But holy moly is this a great Poll system from what I’ve seen!

  15. Chris R says:

    is there a download for the poll?

    * sorry if i’m being lazy and can’t find it.

  16. Mike,

    Are you using the cookie just for convenience sake? As in, “poll vote cookie is present, don’t show questions but show results” ? Or is there something else you’re doing with it (as well) ?

  17. Tyler says:

    The poll doesn’t work in safari 1.0.3. I can select my choice, but nothing happens when I click “vote”. Just a heads up for the testing.

    And by the way, the cam is my favorite feature. Especially when it catches a para-sailer (sp?) in mid air. WOOT!

  18. jonner says:

    hmm, I got this after voting:
    Permission denied in vote.php on line 60

    Warning: fwrite(): supplied argument is not a valid stream resource in vote.php on line 61

    Warning: fclose(): supplied argument is not a valid stream resource in vote.php on line 62
    Mike Industries Poll

    What is your favorite feature to be added to Mike Industries in the last year?

    * The sIFR headlines.

    26%
    * The readability tools.

    3%
    * The Puget Sound Live Cam.

    13%
    * The Mike Industries mobile version.

    4%
    * The CSS Style Switcher.

    9%
    * This here fancy Ajax polling system.

    45%

    Total Votes: 196

  19. Uh…

    Permission denied in vote.php on line 60

    Warning: fwrite(): supplied argument is not a valid stream resource in vote.php on line 61

    Warning: fclose(): supplied argument is not a valid stream resource in vote.php on line 62

  20. Paul says:

    Voted ok, vote results appeared but some debug kind of text was also printed. Shown below:

    Permission denied in vote.php on line 60

    Warning: fwrite(): supplied argument is not a valid stream resource in vote.php on line 61

    Warning: fclose(): supplied argument is not a valid stream resource in vote.php on line 62

  21. Mike D. says:

    Faruk: Yeah, the cookie is out of convenience and also just an extra measure to guard against things like expiring IPs. Nothing is perfect, but the combination of cookies and IPs works pretty well. I think the next version may check your IP on every page load so as to eliminate the “appearance” of voting twice. But then again, it’s kind of a built-in anti-spam measure. People can keep clearing their cookies, thinking they are voting multiple times, but their vote won’t count.

  22. JD says:

    Here’s why testing is good folks:

    If you want my $0.02: try using some sort of mutex (or a semaphore). PHP doesn’t work well when trying to edit a file when its open. I know becuase I’ve done this exact same thing before.

    the ajax is a nice touch though.

    Permission denied in vote.php on line 60

    Warning: fwrite(): supplied argument is not a valid stream resource in vote.php on line 61

    Warning: fclose(): supplied argument is not a valid stream resource in vote.php on line 62

  23. Mike D. says:

    Jonner, Matthew, Paul, and JD: Thanks… I was messing around with the data files and screwed up a permission, it appears. Should be fixed now.

    JD: Thanks for that tip about semaphores… looking into it.

  24. Any chance of you letting us see the code behind your voting script in case any of us would like to use polls on our websites or projects? Just curious as I am in need of a good and free (preferrably standards based) polling script to use in a project.

  25. Mike

    popsicle-stand-of-a-site

    Would that be incomparison to your company or?

  26. Mike, nice implementation! Er, nothing more to say than that.

  27. Jack says:

    Actually, my favourite feature are the free iPod shuffles. :P

  28. Hey Mike, is the underlying power behind this a DB, or is it flatfile (and how easy to you see them being able to be switched)?

    For gloss, perhaps after the results are displayed, the poll could reorder itself to the number 1 option on top. If you plan on adding live tabulating, this could be an awesome thing to see the places flip-flopping on a hot topic.

    A treat to see something very straightforward and simple. It does the exact task asked of it.

  29. joel max says:

    nice trick there!
    im wondering if any of you guys here know of a rating system implementation that uses ajax? im really looking for a better way of doing a rating system and im trying to get ideas to improve on the 1 star to 5 stars rating i used to do with a dropdown.

    thanks

  30. AkaXakA says:

    So when are you going to release the Pollajax and support it for the rest of your days?

  31. Joel says:

    Some polls that I have worked allow for ‘peer pressure’ and would let you change your mind. So in addition to checking the IP address you could check to see if the vote was different and if so change it. Agreed this could make for a tug of war in the coffee shop model…

  32. Tom says:

    Looks good, some messing around with bad query strings showed me your home directory. I don’t quite know what I could do with that but I assume its not so good.

  33. Mike, you may consider highlighting or placing some text around the actual option the person voted for. This is quite slick – congrats :)

  34. Rick says:

    I would like to see the poll results implemented as a graph as well as the normal bar results. Not that you work for me, just another visual twist :)

  35. Anders says:

    Really nice! I wouldn’t say it’s working with javascript turn off though. Anyway, really nice implementation.

  36. Ian says:

    Hi Mike.

    I’ve been reading this blog for a long time, and really love it. The only reason I never comment if because everything I want to say gets said in the first 3 comments.

    I use deer park as well, and found a way to fix the page until Mozilla fixes whatever problem is causing it.

    For those who use deer park and want to fix it, you’ll need to put the following in your userContent.css file

    @-moz-document domain(mikeindustries.com)
    {
    	#sidepane
    	{
    		margin-left: 0 !important;
    	}
    
    	.lightcomment,
    	.darkcomment
    	{
    		overflow: hidden;
    	}
    }

    An explanation on how to edit userChrome.css can be found here.

    Once again, I really love visiting your blog. Mainly because while you create awesome things, you never make any of it seem over my head.

  37. Mike D. says:

    Yannick: I might release the poll code… not sure yet.

    Jakob: Each poll is an individual flat XML file right now. Could be switched to a database pretty easily though.

    Ian: Thanks for the bit of CSS. Sounds like a problem somewhere within the comments. I’ll try and bake that stuff in.

    Everyone else: Thanks for the suggestions. Good stuff.

  38. Mike,

    I think it would still be advisable to do the IP check, I think. If anything, it protects you (or rather, the site) against those who write little scripts to flood-vote the system, thinking that it’ll work because they can vote multiple times (or so it seems).

    Sure, anyone who checks after 5 votes will notice nothing happened, on a site like this, but scriptkiddies aren’t known to check whether their efforts have any effect.

  39. I have a similar polling system in my bulletin board software k4 BB. I have yet to make the polls work with AJAX, though much else already does. We seem to have the same idea of inline polling, however I think I have take then idea a bit further, and you might consider implementing it if you feel like going all out:

    The polls on my forums start of as BB code, so you can have multiple polls spread out anywhere in your text.

    Though I doubt that you would bloat your entries with more than one poll, it might be a feature to implement if you are going to release the source code so that others can benefit from even more flexibility :D

  40. antonio says:

    prova prova

  41. Eric says:

    Is there anyway you can release a public testing version of this? I am in desperate need for a pool like this on one of my sites!

  42. Vizu says:

    We recently developed a way to create polls and export them to other sites with a fair degree of customization. We would love some feedback on how it works for you. It should work fine on websites and in Typepad or Livejournal blogs. We have not yet tuned it to work in all blogs.

    Go to http://www.Vizu.com.
    Register
    Find a poll you’d like to export or create your own poll.
    On the poll results page, click the “Export to my site or blog” icon.
    Customize the look of the poll.
    Clip the code to input the poll into your site or blog.

    If you have ideas or thoughts on how to improve things, sent a note to feedback @ vizu.com.

  43. qwerty says:

    Hi,
    Are you planning to release the code?
    Thanks.

  44. Abhishek says:

    I need some help please!!

    I want a similar poll for my blog, but everything i try doesnt work against dynamic ips..

    I could vote as many times as i want on your poll too..I just need to clear my cookies, disconnest from the net, and reconnect..The vote count increases..

    Any solution??

  45. An AJAX Widget I like!

    I don’t like much that’s done with AJAX because it’s usually too much. If you change half my screen then you should really just be reloading the page. However, Mike Davidson has done a little polling widget for inside blog posts whic…

Leave a Reply

Shared

Hundreds of headlines wash over us every day. And part of why many of us engage in this flow is because we have faith that over time, this torrent of episodic knowledge is going to cohere into something more significant: a framework for genuinely understanding an issue. And we live with it ’cause it sort of works. Eventually you hear enough buzzwords like “single-payer” and “public option” and you start to feel like you can play along.

But mounting evidence indicates that this approach to information is actually totally debilitating. Faced with a flood of headlines on an ever-increasing variety of topics, we shut off. We turn to news that doesn’t require much understanding – crime, traffic, weather – or we turn off the news altogether.

- Matt Thompson on why the way we report and consume news is precisely wrong. Matt is, of course, precisely right. If you’re at SXSW next week, I don’t know how you could justify missing this talk.

Cameron’s Colosseo letterpress poster is now available: The only question is, black or white? The black is oh so tempting!

Jon Stewart Skewers Media’s Obsession with Chat Roulette: Funniest Wii Craps reference ever, as well. It’s really interesting to me that Chat Roulette is getting this much “attention” when TinyChat has been around so much longer, essentially does the same thing and more, and is much more useful to the average person. Just goes to show how viral public sex acts can be.

"Add features and customers forever and rake in the dough.":

The 2005 email that spawned Picnik, Google’s latest buy. If you’re thinking about launching a startup, you should study this e-mail carefully. It’s a perfect example of exactly how a crazy little thought becomes a big idea, and even on its own, it’s better than most “official company business plans” people present to VCs.  I gave a talk at Webstock in New Zealand a couple of weeks ago about creating a startup and I wish I had this to dissect at the time. Really good stuff.

Tumblr Finally Rolls Out Comments. Sort Of. Trolls Not Welcome. :

I actually really like how clubby it is.  Unfortunately it means I won’t be commenting on any Tumblrs since I don’t officially “follow” anyone besides via RSS, but that’s probably ok. Maybe the answer to the world’s wide-open commenting problem is something like this.

Episode 2 of Dan Benjamin's "The Conversation" is Live:

I was a guest on Dan Benjamin’s new weekly radio show last week, along with Merlin Mann, Christina Warren, Adam Keys, and Dave Nanian. Subjects discussed include Newsvine, keeping your own identity after becoming part of a big company, and the RADICAL concept of only publishing stuff to your readers and followers that is actually true.

LESS - Leaner CSS:

Given that pre-compiling CSS is an official “best practice” these days, why not use that compile step to extend CSS in powerful ways? LESS lets you use variables, nested rules, and other niceties at author-time to clean up your rules and keep everything tidy. I believe The Wolf made something like this a few years ago, but I haven’t heard about it since.

How 3D works, and why it's back:

Great article on the ins and outs of three dimensional imagery. Still doesn’t change my opinion that well-shot conventional cinematography is more impressive than the novelty that is Avatar.

The Importance of Removing Features:

This is one of the most useful articles I’ve read in a long time. As we work on focusing, strengthening, and simplifying Newsvine, the concepts discussed by Lukas ring true. “Saying no” has never been a strong suit of mine. It’s very helpful to remember how important of a quality it is. (via fullstopinteractive)

Newly released video of the space shuttle Challenger disaster: It was 24 years ago, I was in 5th grade, but I remember it like it was yesterday. School was stopped immediately and they wheeled out televisions in every classroom for us to watch the news footage. It’s great that this video has been released, but holy crap, how do you tuck something that away for two decades???

A nicely done british parody of 60 Minutes style video journalism. It’s easy to miss how formulaic our news is sometimes. (via B-Tizzle, originally via E-Chizzle)

Colosseo: This is why Cameron is a king and we are all just pawns in his world. I can’t wait to get my hands on this poster. I will point out, however, that the outro credits on the video need some kerning. Someone is going to lose their right hand for that.

Spezify:

New ways of searching are almost never as useful as old ways of searching. Spezify is pretty awesome though. It’s a visually interesting, never-ending, horizontally and vertically scrollable, topic explorer. I don’t think I’d use it for digging deep on anything, but to get a quick visually rich sampling of a topic, it’s quite fun (via tiff, a long time ago actually, over email).

Realism in UI Design:

Reminds me of my favorite logo design advice: “Never waste a stroke”. (via gruber)

Overshared
At the first Doughty show of the night at the Triple Door. If you're in Seattle you should come down for the 2nd at 10. Excellent!
This Kindle ad is cute and Applelike but misses the mark. Advertise what you do well: price and battery life http://bit.ly/cFBw70
@codinghorror Aliased Monaco 9 should be in the Smithsonian.
Why does the media continue to cover what Rob Glaser thinks about the future?
@Trenti Ummm, the Timex Sinclair came out after the VIC-20, beeeeeeeayatch! I will out-old you any day!
@paulsmith Wow. I love the user manual shooting out from Shatner's shoulder at the perfect angle. http://j.mp/am10eU
@paulsmith You have me beat by mere months there! I cut my teeth on a Practical Peripherals 1200 bauder.
@roblifford Probably a 10% chance I fly in at the last minute for a couple of nights. Other than that, planning to skip this year.
I can't believe @shauninman's first computer was a G4. I feel ancient. Mine was a VIC-20. http://5by5.tv/pipeline/5
Wow, how did I not know about Lala until now? Tons of great full albums, free: http://bit.ly/dBrdLw
Thanks for everyone who suggested Brizzly. Going to fire that sucker up again...
Is there a way to unfollow people but still allow them to DM you? Like a "mute" setting or something?
@levifig Burn-in was a bigger issue with first-gen plasmas. They are much better now. LCDs have their own lighting issues as well.
@horsedreamer The black isn't quite as good as some other top plasmas, but it's better than all LCDs. At an inch thick, I'll take it.
@levifig Isn't ghosting mainly an issue for LCDs? I've had a plasma for four years and no ghosting whatsoever.