#!/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="[$(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