Commit fe5d45ba authored by Michael Raskin's avatar Michael Raskin
Browse files

Syncing from Monotone at 20201107-024745. Last commit message was | merge of...

Syncing from Monotone at 20201107-024745. Last commit message was |   merge of '7de2889c764aa5d2059090c87ba60e20141b9af1'
|        and '9125507e289290f5de93023e54744fbd6326401e'
|
|   Changes against parent 7de2889c764aa5d2059090c87ba60e20141b9af1
|
|     added    save-web-page-curl.sh
|     attr on  save-web-page-curl.sh
|         set  mtn:execute
|          to  true
parent 611d0292
......@@ -220,6 +220,11 @@
(type (eql :element)) (tag (eql :s)) element)
(format nil "{-- ~a --}" (call-next-method)))
(defmethod html-element-to-text-dispatch
((protocol show-formatting-mixin)
(type (eql :element)) (tag (eql :strike)) element)
(format nil "{-- ~a --}" (call-next-method)))
(defmethod html-element-to-text-dispatch
((protocol show-formatting-mixin)
(type (eql :element)) (tag (eql :i)) element)
......
#! /usr/bin/env bash
set -x
target="$HOME/mnt/query-fs/backing-store/saved-web/$(date +%Y/%m/%d/%H-%M-%S/)"
mkdir -p "$target"
target="$(mktemp -d -p "$target")"
basename="$( ( echo "$1"; date +%Y%m%d-%H%M%S; ) | sha256sum | sed -e 's/ .*//' )"
cd "$(dirname "$0")"
url="$1"
if ! echo "$url" | grep -E '^[a-z]+:' > /dev/null; then
url="https://$url"
fi
echo "$url" > "$target/$basename.url"
curl -L "$url" > "$target/$basename.html"
./dump-html.sh "$url" < "$target/$basename.html" > "$target/$basename.html.txt"
shift; shift
if test -n "$1"; then
"$@" "$target/$basename.html.txt"
else
echo "$target/$basename.html"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment