A very fancy bit of code - produces a winner |
There were only a few entries. I had planned to use a rather complex system using an excel spreadsheet and a random number generator. A friend at work who is a bit of a whizz with Javascript gave me the following code which will take all the comments and exclude me and then randomly generate a winner.
function getCommentAuthors(from, selector){ var authorEls = from.querySelectorAll(selector), authorNames = []; [].forEach.call(authorEls, function(a){ authorNames.push(a.textContent); }); return authorNames.sort(); } var authors = getCommentAuthors(document.getElementById('comments'), 'cite.user:not(.blog-author) a'), randomisedAuthor = authors[Math.floor(Math.random() * authors.length)]; console.log(randomisedAuthor);So a while ago I ran the code on that page using Chrome's javascript console and it produced the winner.
The winner is:
Michel van Ipenburg
Congratulations!
My commiserations to those who didn't win but the Buzzle ball will be available on-line soon.
I'm one lucky guy tonight! Thanks Kevin!
ReplyDeleteMy pleasure!
DeleteI'll post it later this week.