#!/bin/sh ## ## SCRIPT: 00_GEN_ahrefTagsDownHTMLpage_forVIDEOfiles.sh ## ## PURPOSE: Generate an HTML file with links to video files ## down the page. ## ## METHOD: Put this script in a directory of video files --- ## preferable '.mp4' and/or '.webm' files, but ## '.mpg' and '.avi' and '.wav' files are also ## accepted. ## ## Run this script which puts the resulting HTML file ## in the directory with the video files. ## ## The script puts the video filenames in ## statements down the HTML text file. ## ## The HTML file will need to be edited to add an ## appropriate title --- and some decorative images ## may need to be added (or the pertinent img-src ## statements should be commented or removed). ## ## The INTRODUCTION and other text sections should be ## edited to change the text appropriately --- or remove ## the text sections which are not needed/wanted. ## ## The HTML file can be edited to change the order of ## the videos down the page by moving the a-href statments. ## ## By clicking on the a-href 'links', it is expected that ## a 'helper application' for playing video files has ## been set up in the web browser that reads the HTML file. ## ## You may need to adjust the location of the parent ## directory of the CSS and JS files referenced near ## the top of the HTML file. ## ## The HTML file should be renamed to a more descriptive ## filename. ## ## Started: 2021apr10 Based on a similar script ## 00_GEN_imgsDownHTMLpage_jpggifpngFiles.sh ## that is used for image and animated-gif files. ## Changed: 2021..... ## FOR TESTING: # set -v set -x ## ## Initialize the htm output file. ## HTMFILE="00_RENAME_ME.htm" echo " Title Goes Here

Title Goes Here

subtitle goes here

INTRODUCTION :

yada yada yada


How the videos are presented :

Each video is shown as a link with the name of the video file as the text of the link.

Click on the text (filename) to play the video.

    The filename of each of the videos may contain an indication of the time-length of the video (minutes and seconds) and the image size (examples: 320x240 or 640x480 or 1024x720). The filename typically indicates the subject matter of the video. And filenames may contain identifying numbers.

The video will appear in a separate tab of your web browser --- or in a separate window.

    Many 'modern' web browsers (released since about 2017) are capable of playing '.mp4' and '.webm' videos without the 'help' of a separate ('stand-alone') video player on your computer. BUT ...

    It may be the case that a 'helper application' for playing video files needs to be set up in the web browser that is used to 'render' this HTML file. That video-helper may be specified using a 'Preferences' option or other such option of the web browser.

    A 'helper application' video player may need to be defined to play video formats other than '.mp4' and '.webm' --- such as '.mpg' and '.avi' and '.wav'.

Movie links: " > $HTMFILE ## ## Set the filenames list - according to file suffixes. ## ## (The dollar sign indicates the end of the filename. ## We do not want to include video files with a ## descriptor added onto the filename, such as ## '_2021apr10' or whatever.) ## ## Video suffixes may be added or removed from this list. ## # FILENAMES=`ls | grep '\.jpg$'` FILENAMES=`ls | egrep '\.mp4$|\.webm$|\.mpg$|\.avi$|\.wav$'` ## FOR TESTING: # echo "$FILENAMES" > $HTMFILE # exit ## ## START THE LOOP on the filenames. ## FILECNT=0 for FILENAME in $FILENAMES do FILECNT=`expr $FILECNT + 1` # FILENAMECROP=`echo "$FILENAME" | sed 's|\.mp4$||'` # FILENAMECROP=`echo "$FILENAME" | sed 's|\.mp4$||' | sed 's|\.webm$||'` ## Write out video-link statement. echo "

$FILENAME " >> $HTMFILE done ## ## END OF FILES LOOP. Write out bottom of htm file. ## echo "

For more videos (and images):

Here are some links to WEB SEARCHES for more videos (and images) related to this subject.

Bottom of this
Title Goes Here page.

To return to a previously visited web page location, click on the Back button of your web browser, a sufficient number of times.

OR, use the History-list option of your web browser.

OR ...

< Go to Start of Video-Links, above. >

< Go to Top of Page, above. >

Or you can scroll up to the top of this page.


Page history:

Page was created 2021 xxx 00.

Page was changed 2021 xxx 00.
(Added ....)

" >> $HTMFILE ## ## SHOW HTML FILE with a web browser. ## # firefox "$HTMFILE" & $HOME/bin/seamonkey64/seamonkey "$HTMFILE" & # palemoon "$HTMFILE" & ## ## EDIT HTML FILE with a GUI editor. ## # kwrite "$HTMFILE" /usr/bin/scite "$HTMFILE" # gedit "$HTMFILE"