summary refs log blame commit diff stats
path: root/README.org
blob: 3e1f470e96618943e2069e0ecf4431bb3dfa8de7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                                     



                                                                      





                                                                      
                                                              
                                                  
                                                                  





                                                        
                                 
                                                 

                       






                                                                        

                                            
         
              


                                                                        


                                                                      
               

                                                                     
#+SETUPFILE: ~/.emacs.d/org-templates/projects.org
#+EXPORT_FILE_NAME: index
#+TITLE: Draco

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. It's limited by
the reddit API.

| Project Home    | [[https://andinus.nand.sh/draco/][Draco]]           |
| Source Code     | [[https://git.tilde.institute/andinus/draco/][Andinus / Draco]] |
| GitHub (Mirror) | [[https://github.com/andinus/draco/][Draco - GitHub]]  |

*Tested on*:
- OpenBSD 6.8 (Perl v5.30.3)

* Why?
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.
* Demo
This was recorded with =asciinema(1)=.

[[https://asciinema.org/a/373860][https://asciinema.org/a/373860.png]]

+ Draco v0.1.2: https://asciinema.org/a/373860
  - alt-link: https://andinus.nand.sh/static/draco/v0.1.2.cast
+ Draco 2020-11-19: https://asciinema.org/a/373851
  - alt-link: https://andinus.nand.sh/static/draco/2020-11-19.cast
* Installation
#+BEGIN_SRC sh
# Clone the project.
git clone https://git.tilde.institute/andinus/draco && \
    cd draco

# Install dependencies. (OpenBSD)
doas pkg_add p5-Unicode-LineBreak p5-JSON-MaybeXS
cpan install HTTP::Tiny

# Install dependencies. (Debian - apt based)
sudo apt install libunicode-linebreak-perl libjson-maybexs-perl \
     libhttp-tiny-perl

# Install dependencies. (Fedora - dnf based)
sudo dnf install perl-JSON-MaybeXS perl-HTTP-Tiny perl-Unicode-LineBreak

# Install. (Use sudo if doas is not present)
doas make install
#+END_SRC
* Dependencies
** Unicode::LineBreak
This is used to wrap the text at 76 columns. Draco can work without this
module.
** JSON::MaybeXS
This module is required for Draco to work, it can be replaced with any
other module that parses JSON & produces same data structure.
** =HTTP::Tiny=
Draco can work without this module if you can get the file some other
way.