Draco is a script to convert reddit thread to Org document. It accepts a url & prints the Org document to STDOUT. It'll also print comments along with their replies.
|Source Code||Andinus / Draco|
|GitHub (Mirror)||Draco - GitHub|
I reference things from the web in my Journal & don't want those links to break so I save them locally. Previously I used to manually archive the whole thread, this automates it.
Follow these instructions to get draco & then install the dependencies, they're listed below. All dependencies are in Debian & Fedora repositories.
Check the News section before updating or downloading latest release.
All commits will be signed by my PGP Key.
# Clone the project. git clone https://git.tilde.institute/andinus/draco cd draco # Install draco. Use `sudo' if `doas' is not present. doas make install # Install dependencies. See the section below.
doas pkg_add p5-Unicode-LineBreak p5-JSON-MaybeXS cpan install HTTP::Tiny
sudo apt install libunicode-linebreak-perl libjson-maybexs-perl \ libhttp-tiny-perl
sudo dnf install perl-JSON-MaybeXS perl-HTTP-Tiny perl-Unicode-LineBreak
v0.3.2 - 2020-11-26
author_flair_textto properties section of each comment.
- Keep each dot in a single line. This feature was added in v0.3.0 but each dot was printed in a new line. For huge posts this would be annoying so now dots are printed in a single line.
v0.3.1 - 2020-11-25
- Put author name in code block if it begins & ends with "
_". Org underlines headings that begin & end with "
v0.3.0 - 2020-11-24
This version adds code to fetch all the comments in a thread. Now users can archive the whole thread.
Everyone should get this update, the code has become a lot more complex since v0.1.3. If you don't want to update then you can get the patches for small changes from the git history.
- Fetch all the comments.
- Add debug message for HTTP calls. It'll print a "." for every HTTP call. Users will be able to tell when the script is making HTTP calls.
v0.2.2 - 2020-11-24
This version is mostly structural changes, it'll now be easier to add code to fetch comments hidden behind "continue this thread".
- Add more debug information.
v0.2.1 - 2020-11-24
- Previously fetching comments hidden under "load more comments" would fail if the url passed by user ends in "/". This has been fixed in this release.
v0.2.0 - 2020-11-23
This version makes the script lot more complex. If you download only small threads then this update is not required.
Previous version (v0.1.3) might throw some errors on threads that have comments hidden behind "load more comments" but the rest of thread will be saved.
This version will load all those comments hidden behind "load more comments". But not those hidden behind "continue this thread". This is a known bug.
- Add "[S]" after submitter's comments.
- Print comments hidden under "load more comments".
- Document environment variables in manual.
- Add "limit=500" & "sort=top" to all posts/comments.
- Print more information when debug is on.
- Add help option.