Download articles for offline viewing as simple HTML, themed html, epub or markdown.
Go to file
lee2sman e0d111b050 update README.md 2022-01-14 14:00:41 -05:00
lib add comments 2021-07-20 17:19:49 -04:00
themes rename bookmobile 2021-12-31 03:52:36 -05:00
.gitignore add .gitignore 2021-07-20 20:16:09 -04:00
LICENSE add LICENSE 2021-12-31 03:52:45 -05:00
README.md update README.md 2022-01-14 14:00:41 -05:00
bookmobile minor spacing correction in usage 2022-01-01 21:52:25 -05:00
bookmobile-gui add bookmobile-gui 2022-01-02 03:13:46 -05:00
epubmobile.fish add epubmobile function 2022-01-14 13:56:42 -05:00
nyt-medium.jpg add screenshot of reader view 2021-07-21 02:47:33 -04:00

README.md

Bookmobile

Command line script to download articles for offline viewing as simple HTML, themed html, epub or markdown.

This is a brute force fishscript (shell) gluing together pandoc and a Node.js package that implements the Firefox reader view. It uses a NPM package implementing Mozilla's Readability script to scrape off ads, sidebars, footers, headers, etc. If that's not the right solution for you, jump down to the alternatives section at the end.

For example:

rendered NYTimes article
Example New York Times article rendered in the reader view with the 'Medium' theme

Currently, I use this as an alternative to Wallabag or Pocket to download articles I've meant to read later, converting them to epubs with bookmobile. Once a week I drop them on my micro-sd card and load it in my 10 year old offline e-ink e-reader (a Nook Simple Touch, ultra-cheap on eBay!).

Dependencies

  • fish shell
  • Pandoc
  • Node.js / NPM

Install

npm install readability-cli
git clone https://tildegit.org/exquisitecorp/bookmobile.git

Usage

By default bookmobile will download the specified url and save to the current directory as a simplified html document with readability.

./bookmobile http://article.url

Full usage:

Bookmobile: Simple command line script to download articles for offline reading as html, epub or markdown. Saves a simplified html document to current directory as default.

Optionally, you can specify a theme, format, filename and output directory

Usage: ./bookmobile url [ --theme THEME ] [ --format FORMAT ] [ --name FILENAME ] [ --output OUTPUT ]
                    [-h | --help ]

Options:

    --help
    -h         Display usage info

    --theme THEME
    -t THEME   Set theme for reader format. Default: medium
               Theme options: 
               github
               gmi
               medium
               now
               pandoc

    --format FORMAT
    -f FORMAT  Set file format (html, reader, markdown, epub)
               default: html

    --name NAME
    -n NAME Set specified file name instead of defaulting to article title

    --output OUTPUT
    -o OUTPUT  Set output location
               default: current directory

To add themes

The themes subdirectory contains several custom simple themes for rendering a nice reader view. You can edit or add themes here and they will display in the usage help.

Shortcuts

Fish shell function

I use the Fish Shell, an alternative to BASH.

Fish allows use of Functions, which are mostly equivalent to Bash aliases, which let you make easy-to-type shortcuts in the command line.

Since my most common workflow is to download an article and save as an epub, I created the epubmobile shortcut. If you use fish shell you can move to your ~/.config/fish/functions/ folder. Be sure to edit the file to match your own paths. The first path should match the location of bookmobile on your system, and the next should indicate where you want your epubs to automatically be placed. Make sure the original bookmobile is executable on your system using chmod + x.

GUI

A simple yad-based GUI application is included as well.

To install on Debian/*buntu-based systems: apt install yad. Then chmod +x bookmobile.gui to make it executable.

It can be launched from the command line with ./bookmobile-gui or you can create an executable.

Alternatives

Currently there are a number of CLI programs that are ports of the Readability project. These may serve your needs better.

A partial listing can be found here

Contributing

Polite issues and pull requests will be considered!

License

Public Domain