commit 379a99857d4acf3129acba4388fa17e4b002e798 Author: adam Date: Tue Apr 16 21:48:59 2024 -0400 crediting script diff --git a/crediting/Fandom.png b/crediting/Fandom.png new file mode 100644 index 0000000..2f76fd0 Binary files /dev/null and b/crediting/Fandom.png differ diff --git a/crediting/credit.html b/crediting/credit.html new file mode 100644 index 0000000..8a3b891 --- /dev/null +++ b/crediting/credit.html @@ -0,0 +1,43 @@ + + + + + +
+
+
+ [num] +
+
+ [title]
+ [platform img][author] +
+
+
+ + \ No newline at end of file diff --git a/crediting/credit.sh b/crediting/credit.sh new file mode 100755 index 0000000..b226ff1 --- /dev/null +++ b/crediting/credit.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +WORKING=$PWD + +i=0 +while read p || [[ -n $p ]]; do + IFS=';' read -ra FIELDS <<< "$p" + i=$(( $i + 1 )) + echo "i: $i" + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 2- ) + echo "field1: ${FIELDS[1]}" + FIELDS[2]=$( echo "${FIELDS[2]}" | cut -c 2- ) + echo "field2: ${FIELDS[2]}" + sed 's/\[num\]/['"$i"']/' "$SCRIPT_DIR/credit.html" > "$SCRIPT_DIR/credit2.html" + echo "first sed, done" + sed -i 's/\[title\]/'"${FIELDS[2]}"'/' "$SCRIPT_DIR/credit2.html" + echo "2nd sed, done" + if [[ "${FIELDS[1]}" =~ ^"[yt]/" ]] + then + echo "tubelike!" + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 6- ) + echo "${FIELDS[1]}" + sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" + elif [[ "${FIELDS[1]}" =~ ^"[vimeo]/" ]] + then + echo "vimeous!" + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 9- ) + sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" + elif [[ "${FIELDS[1]}" =~ ^"[fandom]/" ]] + then + echo "fandom wiki!" + FIELDS[1]=$( echo "${FIELDS[1]}" | cut -c 10- ) + sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" + else + echo "who?!" + sed -i 's/\[platform img\]//' "$SCRIPT_DIR/credit2.html" + fi + echo "setting author to ${FIELDS[1]}!" + sed -i 's/\[author\]/'"${FIELDS[1]}"'/' "$SCRIPT_DIR/credit2.html" + + echo "file:///$SCRIPT_DIR/credit2.html" + firefox -P screenshitter --headless --window-size 3840,2160 --screenshot "$WORKING/cs1.png" "file:///$SCRIPT_DIR/credit2.html" + convert "cs1.png" -fuzz 12% -transparent "#00ff00" "cs2.png" + convert cs2.png -trim "c$i.png" + rm cs1.png cs2.png "$SCRIPT_DIR/credit2.html" +done < $1 \ No newline at end of file diff --git a/crediting/vimeo.png b/crediting/vimeo.png new file mode 100644 index 0000000..1b68d65 Binary files /dev/null and b/crediting/vimeo.png differ diff --git a/crediting/youtube.png b/crediting/youtube.png new file mode 100644 index 0000000..88c0fe1 Binary files /dev/null and b/crediting/youtube.png differ