Skip to content

Instantly share code, notes, and snippets.

@orgcontrib
Forked from redperadot/vtplayer.rb
Created December 9, 2019 02:56
Show Gist options
  • Save orgcontrib/3f60a75ff57500aa9c07fb64f70188b1 to your computer and use it in GitHub Desktop.
Save orgcontrib/3f60a75ff57500aa9c07fb64f70188b1 to your computer and use it in GitHub Desktop.
A simple script to play vt100 animations.
#!/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