Skip to content

Instantly share code, notes, and snippets.

@grokkingStuff
Last active January 17, 2018 09:42
Show Gist options
  • Save grokkingStuff/58243f9097fa3ac2dae08dca64a374ae to your computer and use it in GitHub Desktop.
Save grokkingStuff/58243f9097fa3ac2dae08dca64a374ae to your computer and use it in GitHub Desktop.
#!/bin/bash
# Source - https://www.reddit.com/r/Python/comments/7qwuwy/free_python_book/dst4hum/
# Was too lazy to download all books at once
# Source code of website scraped to get names of books
wget -qO- http://goalkicker.com | \
grep "bookContainer grow" | \
cut -c 44- | \
cut -d' ' -f1 | \
rev | \
cut -c 6- | \
rev | \
# Names of books changed into download link
sed 's/.*/http:\/\/goalkicker.com\/&Book\/&NotesForProfessionals.pdf/' | \
# Limiting wget so that it doesn't affect you too much
xargs -0 -n 1 -P 8 wget -q
#!/bin/bash
# geirha from the same channel did the same thing using lynx and it's much better. No html parsing!
lynx -dump -listonly -nonumbers http://goalkicker.com | \
sed 's,\(.*\)/\(.*\)Book$,\1/\2Book/\2NotesForProfessionals.pdf,' | \
xargs -0 -n 1 -P 8 wget -q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment