Skip to content

Instantly share code, notes, and snippets.

@hkdnet
Created November 20, 2017 14:57
Show Gist options
  • Save hkdnet/2019f42b713a1448fb475f7b65fae28c to your computer and use it in GitHub Desktop.
Save hkdnet/2019f42b713a1448fb475f7b65fae28c to your computer and use it in GitHub Desktop.
3s 3sec
4s 4sec
#!/usr/bin/env ruby
ARGV.each do |e|
text = File.read(e)
text.split("\n").each do |line|
span, message = line.split(/ |,/)
sec = case span[-1]
when 's' then span[0..-2].to_i
when 'm' then span[0..-2].to_i * 60
end
sleep sec
system("say '#{message}'")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment