Skip to content

Instantly share code, notes, and snippets.

@AkBKukU
Created September 6, 2021 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkBKukU/478edf9baf2847f3e3120b2ca1b4af39 to your computer and use it in GitHub Desktop.
Save AkBKukU/478edf9baf2847f3e3120b2ca1b4af39 to your computer and use it in GitHub Desktop.
Youtube Mebers List parser
#!/bin/bash
echo "Youtube Member List HTML Parser"
yt_list="$(date --iso-8601)_yt-members.csv"
# Read HTML from file by line
while read -r line <&9
do
if [[ "$line" == *"sponsor-info-name"* ]]
then
#echo $line | sed -e 's/*sponsor-info-name style-scope ytsp-sponsors-dialog">\(.*\)<\/div*/\1/'
trim="${line##*'sponsor-info-name style-scope ytsp-sponsors-dialog">'}"
trim="${trim%%'</div'*}"
echo $trim >> $yt_list
fi
done 9< <(cat $1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment