This repository has been archived by the owner on Mar 5, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 531
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 in your terminal with googler
. All of them use the Mercury Web Parser API 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
- Get the latest
reader.py
script. Save it in your path. - Register and generate a personal API key at Mercury Web Parser
- 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 replaced with the API key generated in step 2. The text is piped to the PAGER
.
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!