#!/bin/bash
rest=""
if [ -z "$1" ]; then
  echo "Radio Play via comma separate YouTube 11 character IDs or search ideas for a playlist ... 7 such uses Shower Songs ... egs. Tragedy,Boogie Wonderland,Down Among the Dead Men flash ... random ... Tragedy ,Imagine*3,Breezin ... ordered 5 ... Tragedy  ,Pina Colada Song,Fast Car ... audio ... Tragedy   ,Galveston,Fix You    ... audio ordered,    and go."
  read ans
else
  preans="$1"
  ans="$1 $2 $3 $4 $5 $6 $7 $8 $9"
  while [ ! -z "$9" ]; do
   shift
   rest="${rest} $9"
  done
  ans="$ans${rest}"
fi
if [ ! -z "$ans" ]; then
 commas_only="${ans//[^,]}"
 if [ "${#preans}" == "83" ]; then
  if [ "${#commas_only}" == "6" ]; then
   open "https://www.rjmprogramming.com.au/$1"
  else
   open "https://www.rjmprogramming.com.au/HTMLCSS/swipe_media.html $ans"
  fi
 else
  open "https://www.rjmprogramming.com.au/HTMLCSS/swipe_media.html $ans"
 fi
fi
exit
