Created
September 6, 2021 16:41
-
-
Save AkBKukU/478edf9baf2847f3e3120b2ca1b4af39 to your computer and use it in GitHub Desktop.
Youtube Mebers List parser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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