Created
November 20, 2017 14:57
-
-
Save hkdnet/2019f42b713a1448fb475f7b65fae28c 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
3s 3sec | |
4s 4sec |
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 | |
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