Skip to content

sainathadapa/reddit2mobi

Repository files navigation

reddit2mobi

This project helps to export a reddit post into a mobi/epub via html.

Instructions

  • Install NodeJS and npm
  • Clone this repo
  • cd reddit2mobi; npm install
  • Run run_reddit2html.js script.
    • Pass the url of the reddit post as an argument. Optionally, pass the depth (integer) to limit the maximum depth of subtrees in the thread.
    • Usage: nodejs run_reddit2html.js url depth > out.html
  • Install Calibre
  • Convert the generated html into epub/mobi using the ebook-convert from Calibre.
    • Usage: ebook-convert in.html out.mobi

Other resources

  • See the example files to see the sample generated output.
    • Example files are generated by these commands:
    • nodejs run_reddit2html.js https://www.reddit.com/r/MachineLearning/comments/2fxi6v/ama_michael_i_jordan/ 10 > example1.html
    • ebook-convert example1.html example1.mobi
    • nodejs run_reddit2html.js https://www.reddit.com/r/Android/comments/2jbt42/google_announces_android_50_lollipop 3 > example2.html
    • ebook-convert example2.html example2.mobi
  • Reddit API
  • Ebook-convert