summaryrefslogtreecommitdiff
path: root/plainweb
diff options
context:
space:
mode:
Diffstat (limited to 'plainweb')
-rwxr-xr-xplainweb20
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"
+
+