Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Terminal Reading Mode or Reader View

Arun Prakash Jana edited this page Sep 3, 2017 · 19 revisions

Here are some techniques to read news in a clean, ad-free environment without leaving your terminal. All of them use the Mercury Web Parser indirectly.

Using Justread

You can fetch cleansed data from JustRead by tweaking the url you want to fetch. Save the following script as reader:

#!/bin/bash

elinks "http://justread.mpgarate.com/read?url=$1"

Note that the cmdline web browser elinks is used in the script.

Using reader

  1. Get the latest reader.py script. Save it in your path.
  2. Register and generate a personal API key at Mercury Web Parser
  3. Save the following script as reader:
#!/bin/sh

reader.py $1 -k mercury_key -w 100 | jq -r '[
    (if .title then "# "+.title else empty end),
    (if .author then .author else empty end),
    .content.text
] | join("\n\n")' | $PAGER

Note that mercury_key needs to be placed with the API key generated in step 2. The text is piped to the PAGER.

Invoke reader

To invoke reader when reading news in googler, add the following alias in your shell's rc file:

alias news='googler -N --url-handler reader'

You can add your personal preferences like language, country etc.

Fire news with keywords to read the latest news!