diff --git a/yt-data-pull.sh b/yt-data-pull.sh new file mode 100755 index 0000000..436d4d8 --- /dev/null +++ b/yt-data-pull.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# while read p; do ./yt-data-pull.sh $p; doneinfo.json + +cat info.json | jq -r .comments[].id >commentids.txt +touch done.txt + +while read cid +do + echo "cid: --> $cid." + if grep "$cid" done.txt + then + #already seen + echo "already seen $cid" + else + cat info.json | jq .comments[] | jq 'select(.id=="'$cid'")'>thiscomment.json + echo $cid >>done.txt + message="[YT]/[$(cat info.json | jq -r .title)]/[$(cat thiscomment.json | jq -r .author)]: $(cat thiscomment.json | jq -r .text)" + rm thiscomment.json + chat $message + fi +donecomments.csv + +popd