Created
May 11, 2010 11:21
-
-
Save paulanthonywilson/397193 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Raffle script. Uses Quicksilver (http://docs.blacktree.com/quicksilver/what_is_quicksilver) and Applescript | |
# CSV file of attendees was downloaded from EventWax (http://www.eventwax.com/). It needs 2 returns to continue the raffle | |
# - one to bring focus back to the terminal. | |
require 'rubygems' | |
require 'appscript' | |
require 'yaml' | |
require 'fastercsv' | |
module BigType | |
extend Appscript | |
def self.show(display_me) | |
app("Quicksilver").show_large_type(display_me) | |
end | |
end | |
names = [] | |
excludes = ["Paul Wilson", "Graeme Mathieson", "Name", "Alan Francis"] | |
FasterCSV.foreach('conference.csv') do |row| | |
name = row[0] | |
names << name unless excludes.include?(name) | |
end | |
while (true) do | |
puts names.size | |
name = nil | |
1.upto(5 + rand(5)) do | |
puts "*" | |
name = names[rand(names.size)] | |
BigType.show name | |
end | |
BigType.show name | |
puts name | |
names.delete name | |
gets | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment