-
-
Save cesardv/328f73482a6c30076e1d8c801a4e8949 to your computer and use it in GitHub Desktop.
This file contains 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
# Usage: | |
# 1) Ctr+S downloads page to ~/Desktop/books.html | |
# 2) Run script | |
# 3) Find your books in /tmp/humble_books | |
# 4) Read them | |
# 5) Profit | |
cat ~/Desktop/books.html | | |
grep "https://dl.humble.com" | | |
sed -n -E 's/.data-web\=\"(https://dl.humble.com/([.]+).([a-z]+)?["]+)./\1 \2 \3/p' | | |
sed 's/&/&/g' > /tmp/humble_books_list && cat /tmp/humble_books_list | | |
awk '{print $2}' | | |
uniq | | |
xargs -I"{}" mkdir -p /tmp/humble_books/{} && cat /tmp/humble_books_list | | |
awk '{print "curl -o /tmp/humble_books/" $2 "/" $2 "." $3 " \"" $1 "\"" }' | | |
while read line; do eval $line; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment