Making web pages readable in a browser and in the command line 🔗 📖.
This is like a self-hosted version of Pocket, or Firefox Reader View, or any other extension that helps you read an article on the web when using a Desktop browser. But, instead of a browser extension that you have to install, its just a bookmark you can keep on your toolbar or a single line of bash you can run at the terminal.
Websites are parsed with either the free Mercury Web Parser API or a self-hosted version of Mozilla's readability package. The readability package was trasnformed into a Docker image that automatically performs some UTF-8 conversions and tidying.
Try it out at readable.schollz.com.
First download the latest release of readable for your OS. Alternatively, if you have Go installed you can do go get github.com/schollz/readable
.
You can run readable with or without Docker.
$ docker pull schollz/readable
$ ./readable
Get YOUR_API_KEY
Mercury Web Parser API Key from here (its free).
$ readable -key YOUR_API_KEY
The Docker image in this repo allows you to manipulate websites into readable ones. You can do some neat things like the following:
You can use the Docker image to directly read articles from the command line:
$ URL=http://www.cnn.com/2017/10/03/world/nobel-physics-prize-2017/index.html
$ docker run --rm -t schollz/readable $URL | more
----------------------------------------------------------
Nobel Prize in Physics goes to 'black hole telescope' trio
----------------------------------------------------------
Story highlights
- The development proves Einstein's prediction of gravitational waves
- More than 1,000 people worked on the technology over four decades
(CNN)The 2017 Nobel Prize in Physics has been awarded to Rainer Weiss,
Barry C. Barish and Kip S. Thorne for their detection of gravitational
waves, a development scientists believe could give vital clues to the
origins of the universe.
...
You can use the Docker image to download the parsed contents into a json file:
$ URL=http://www.cnn.com/2017/10/03/world/nobel-physics-prize-2017/index.html
$ docker run --rm -v `pwd`:/data -t schollz/readable $URL data.json
$ cat data.json | jq .title
"Nobel Prize in Physics goes to 'black hole telescope' trio"
where URL
is the URL of some article that you want to read. This will result in a file data.json
which contains the results.
MIT