Skip to content

Instantly share code, notes, and snippets.

@captn3m0
Created September 20, 2024 05:02
Show Gist options
  • Select an option

  • Save captn3m0/e4ff8f03c80b009b187c31402b3d0019 to your computer and use it in GitHub Desktop.

Select an option

Save captn3m0/e4ff8f03c80b009b187c31402b3d0019 to your computer and use it in GitHub Desktop.

Revisions

  1. captn3m0 renamed this gist Sep 20, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. captn3m0 created this gist Sep 20, 2024.
    4 changes: 4 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    Generatest EPUBs for all [Original Fiction](https://reactormag.com/fictions/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.
    4 changes: 4 additions & 0 deletions generate.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    #!/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