diff options
author | Ben Sima <ben@bsima.me> | 2021-12-02 08:54:13 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2021-12-02 08:54:13 -0500 |
commit | 833de4152b3dbb234e5833c901fd4e8696fd8169 (patch) | |
tree | 5c607a0a57169af1cfff10ad5c72d1e2f0ab92a7 /plainweb | |
parent | c0862a0adb5a2aceffb5085f6e20e71f87b0bf2e (diff) |
add @jb55's reading scripts
Diffstat (limited to 'plainweb')
-rwxr-xr-x | plainweb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plainweb b/plainweb new file mode 100755 index 0000000..a10f55a --- /dev/null +++ b/plainweb @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +USER_AGENT='User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.15.2 Chrome/83.0.4103.122 Safari/537.36' + +if [ -z "$1" ]; then + printf "usage: plainweb <url>\n" + exit 1 +fi + +HURL="/tmp/$(sha256sum <<<"$1" | awk '{print $1}').txt" +OUT=${2:-$HURL} + +if [ ! -f "$HURL" ]; then + #w3m -header "$USER_AGENT" -dump "$1" > "$HURL" + w3m -dump "$1" > "$HURL" +fi + +exec lessr "$HURL" + + |