-
-
Save orgcontrib/3f60a75ff57500aa9c07fb64f70188b1 to your computer and use it in GitHub Desktop.
A simple script to play vt100 animations.
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 | |
# | |
# vtplayer.rb - A simple script to play vt100 animations. | |
# Made with ❤︎ by [email protected] - v0.1 | |
# | |
# Some places to find vt100 animations: | |
# http://artscene.textfiles.com/vt100/ | |
# http://www.scovetta.com/archives/textfiles/art | |
require 'open-uri' | |
Signal.trap("INT") { puts; exit 0 } | |
abort("[Error] Need a file to play. Give the path of a remote or local file as an argument.") if ARGV[0].nil? | |
path = ARGV[0] | |
file = ( path[0,4] == 'http' ? open(path).read : IO.read(path) ) | |
$stdout.sync = true | |
file.each_char do |char| | |
print char | |
sleep 0.0005 | |
end | |
puts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment