User Tools

Site Tools


dump

Dump webpage as HTML

#!/bin/sh -e

# Sanitize filename
filename=$(echo $UZBL_TITLE | tr -C '[:alnum:]\n' '_')

# Ask user for better filename
filename=$(zenity --file-selection --confirm-overwrite --save --filename $filename.html)

echo 'js document.documentElement.outerHTML' | \
    socat - unix-connect:"$UZBL_SOCKET" > $filename

Dump webpage as plain text

#!/bin/sh -e

# Sanitize filename
filename=$(echo $UZBL_TITLE | tr -C '[:alnum:]\n' '_')

# Ask user for better filename
filename=$(zenity --file-selection --confirm-overwrite --save --filename $filename.txt)

echo 'js document.documentElement.outerHTML' | \
    socat - unix-connect:"$UZBL_SOCKET" | \
        lynx -dump -stdin > $filename
dump.txt · Last modified: 2016/08/31 14:10 (external edit)