Generatest EPUBs for all Original Fiction published at Reactor (earlier Tor.com) using a combination of curl, pup, ag, xargs, and url-to-epub.
Final output should be roughly 700+ EPUBs weighing around 250MB.
Generatest EPUBs for all Original Fiction published at Reactor (earlier Tor.com) using a combination of curl, pup, ag, xargs, and url-to-epub.
Final output should be roughly 700+ EPUBs weighing around 250MB.
#!/bin/bash | |
curl -s 'https://reactormag.com/wp-admin/admin-ajax.php?action=listing_results' --compressed -X POST --data currentPage=1 --data sort=newest --data perPage=1000 --data term_slug=original-fiction --data taxonomy=fiction | jq -r .html > listing.html | |
cat listing.html | pup 'a attr{href}' | sed 's/^ //' | sort -u |ag -v comments | ag -v "reactormag.com/(author|tag|fictions|new-torcom|download|all-of-tor-coms|all-tor|2014-fiction)" > links.txt | |
cat links.txt | xargs url-to-epub -l en |