Skip to content

Instantly share code, notes, and snippets.

@kencoba
Created June 1, 2017 09:58
Show Gist options
  • Save kencoba/5f9591fdb70a74e0a552d8c783058368 to your computer and use it in GitHub Desktop.
Save kencoba/5f9591fdb70a74e0a552d8c783058368 to your computer and use it in GitHub Desktop.
Listing video files.
#! /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