Compare commits

..

2 Commits

Author SHA1 Message Date
dded60ad2c cartographize version 1 2023-09-04 11:39:52 -04:00
4f54aa644e miscChat works, meme schedule doesn't 2023-09-04 10:54:29 -04:00
3 changed files with 85 additions and 0 deletions

64
bash/cartographize.sh Executable file
View File

@ -0,0 +1,64 @@
#!/bin/bash
#
# phase 1: take screenshots
#
if [ ! -d "screenshots" ]; then
mkdir screenshots
fi
find . -iname "*.mp4" -print0 | while read -d $'\0' file
do
filename=$(basename -- "$file")
#extension="${filename##*.}"
filename="${filename%.*}"
ffmpeg -ss 0 -i $file -vf fps=0.5 ./screenshots/$filename%d.png
done
#
# phase 2: img preprocess
#
if [ ! -d "preproccessed" ]; then
mkdir preproccessed
fi
find "screenshots" -iname "*.png" -print0 | while read -d $'\0' file
do
filename=$(basename -- "$file")
extension="${filename##*.}"
filename="${filename%.*}"
convert "$file" -gravity SouthWest -crop 560x60+0+0 -fuzz 12% +transparent "#edf1c9" "preproccessed/$filename.png"
done
#
# phase 3: ocr
#
if [ ! -d "ocr" ]; then
mkdir ocr
fi
find "preproccessed" -iname "*.png" -print0 | while read -d $'\0' file
do
filename=$(basename -- "$file")
extension="${filename##*.}"
filename="${filename%.*}"
tesseract $file "ocr/$filename"
done
#
# phase 4: prep for geotagging
#
if [ ! -d "tagged" ]; then
mkdir tagged
fi
find "screenshots" -iname "*.png" -print0 | while read -d $'\0' file
do
filename=$(basename -- "$file")
extension="${filename##*.}"
filename="${filename%.*}"
convert $file "tagged/$filename.jpg"
exiftool -overwrite_original -TagsFromFile ./knowngood.jpg -All:All "tagged/$filename.jpg"
done

13
bash/meme schedule.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
for f in ./*
do
filename=$(basename -- "$f")
extension="${filename##*.}"
filename="${filename%.*}"
if [ "$filename" == "$(date '+%Y-%m-%d')" ]; then
#echo $f
curl -H "Content-Type: multipart/form-data" -F "file=@$f" #webhook url
fi
done

8
bash/miscChat.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
#msg="\"{\\\"content\\\":\\\"$@\\\"}\""
msg="{\"content\":\"$@\"}"
echo $msg
curl -H "Content-Type: application/json" -d "$msg" \
#WEBHOOK URL