Skip to content

Commit

Permalink
Update yt-member-posts.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
prateeksingla authored Nov 21, 2023
1 parent 83b2809 commit 495984b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions yt-member-posts.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
wget --load-cookies cookies.txt -p -k https://www.youtube.com/@AkshatZayn/membership
grep 'contentText' www.youtube.com/@AkshatZayn/membership > extracted_lines
wget --load-cookies cookies.txt -k -O membership https://www.youtube.com/@AkshatZayn/membership
grep 'contentText' membership > extracted_lines
grep -oP 'contentText\K.*?(?=expandButton)' extracted_lines > final.txt
cut -c 21- final.txt > Member_posts.txt
grep -Fvf <(cut -c 1-20 posts.txt) Member_posts.txt | cat - posts.txt > temp && mv temp posts.txt
rm final.txt extracted_lines Member_posts.txt
rm -rf www.youtube.com

jq --raw-input --slurp '{"description":"An updated gist description","files":{"akshat.txt":{"content": . }}}' posts.txt \
| curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: [token]" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/gists/GIST-ID \
-d @-

0 comments on commit 495984b

Please sign in to comment.