Created
June 1, 2017 09:58
-
-
Save kencoba/5f9591fdb70a74e0a552d8c783058368 to your computer and use it in GitHub Desktop.
Listing video files.
This file contains hidden or 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
#! /bin/sh | |
exec ruby -S -x "$0" "$@" | |
#! ruby | |
BEGIN { | |
puts <<-EOS | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=\"UTF-8\"> | |
</head> | |
<body> | |
EOS | |
} | |
$head = gets.chomp | |
puts "<h2>#{$head}</h2>" | |
while $line = gets | |
$line.chomp! | |
puts "<h2>#{$line}</h2><p><video width=\"640\" height=\"360\" controls><source src=\"#{$line}\"/></video></p>" | |
end | |
END { | |
puts <<-EOS | |
</body> | |
</html> | |
EOS | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment