$30 Giveaway Winner!
Hey guys, this is Matt.
I get 10 on with the conclusion to the giveaway which we initiated last week. Now, to do this, I'm going to be picking a random winner and verifying that they're actually subscribed to us. Then I'll be sending them thirty dollars to iTunes. So, I'm just going to walk you through the process that I'm using to do this so you can make sure that it's actually fair and because some of you might actually be interested.
So first off, I went to the commenters section of the video to get a list. I threw up the JavaScript console and ran this nice script which I created. I'll just run it to show you what happens. It lists all of the usernames of everyone who commented on the video. Then I copied these usernames into this text file and deleted those who specifically said they didn't actually want to enter the contest because they don't use iTunes or whatever. So now, this basically includes each line is a different contestant.
Now, to pick a random line from this file, I wrote a Ruby script, which I'll just show you now. It reads all the lines into an array, makes sure there's no duplicates, and then picks a random person. So now, I'll go ahead and actually run this script, and it will determine who won the contest.
And the winner is Sim! I'm not going to try to pronounce that one, but they won. So now, the last step to the giveaway is to determine that they actually commented on the video. To do this, I've set up this little curl command which calls YouTube's API to get a list of a user's subscriptions. I'll just get the list of this person's subscriptions.
I haven't actually verified that this method will give a list of all the subscriptions if there's too many, but if it doesn't have us in the list, I'll verify that. But I suspect that it will. So, let's go ahead and get this list, open it up in XML, search for "Mac," and so on.
And there it is! They are subscribed to Mac Heads 101 on YouTube. So that's all we needed to know. This is the winner, and I will be messaging them the thirty dollars to iTunes.
Um, so I really appreciate all of you guys commenting on this video. It's really refreshing to see so many people who watch our videos come together and leave a message, even if you just want thirty dollars.
Um, so thanks! Thanks for all of your guys' comments. It was well appreciated. Thanks for watching, and goodbye!