Skip to content

Instantly share code, notes, and snippets.

@arvidj
Created December 21, 2018 10:54
Show Gist options
  • Save arvidj/a5149145e1761bc7dd6a9718f44c1ce8 to your computer and use it in GitHub Desktop.
Save arvidj/a5149145e1761bc7dd6a9718f44c1ce8 to your computer and use it in GitHub Desktop.
#!/bin/bash
page=1
while true; do
echo $page;
if ! wget "https://api.github.com/users/standardebooks/repos?page=$page" -O "repos.$page"; then
break;
fi;
page=$(($page + 1))
for i in `grep full_name repos.$page | cut -d\" -f 4 | cut -d/ -f 2`; do
url="https://standardebooks.org/ebooks/"${i/_//}"/dist/$i.epub"
wget $url
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment