aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Paweł Zuzelski <pawelz@pld-linux.org>2010-02-17 18:51:58 +0100
committerGravatar Paweł Zuzelski <pawelz@pld-linux.org>2010-02-17 18:51:58 +0100
commitbeed024a33bad3d4e73560320d099e7c99bee559 (patch)
tree84579e0dfffbf8e7d8ec104550ccdcf08d72d2f1 /examples
parent224b5cd21635773beac5c03fa42e31cdb3545d4a (diff)
dump html from uzbl
There are several reasons to query uzbl for html instead of downloading it again: - save resources (bandwidth, etc) - html may have changed since uzbl downloaded it - we don't have to care about session (whatever that mean. http_auth, cookies, etc)
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/data/scripts/eFormFiller.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/data/scripts/eFormFiller.sh b/examples/data/scripts/eFormFiller.sh
index 44c9912..4c9c1b4 100755
--- a/examples/data/scripts/eFormFiller.sh
+++ b/examples/data/scripts/eFormFiller.sh
@@ -122,12 +122,13 @@ else
# login(text):
# passwd(password):
#
- curl -L "$url" | \
- tr -d '\n' | \
- sed 's/>/>\n/g' | \
- sed -n 's/.*\(<input[^>]\+>\).*/\1/;/type="\(password\|text\)"/Ip' | \
- sed 's/\(.*\)\(type="[^"]\+"\)\(.*\)\(name="[^"]\+"\)\(.*\)/\1\4\3\2\5/I' | \
- sed 's/.*name="\([^"]\+\)".*type="\([^"]\+\)".*/\1(\2): /I' >> $keydir/$domain
+ echo 'js document.documentElement.outerHTML' | \
+ socat - unix-connect:$socket | \
+ tr -d '\n' | \
+ sed 's/>/>\n/g' | \
+ sed -n 's/.*\(<input[^>]\+>\).*/\1/;/type="\(password\|text\)"/Ip' | \
+ sed 's/\(.*\)\(type="[^"]\+"\)\(.*\)\(name="[^"]\+"\)\(.*\)/\1\4\3\2\5/I' | \
+ sed 's/.*name="\([^"]\+\)".*type="\([^"]\+\)".*/\1(\2): /I' >> $keydir/$domain
fi
[[ -e $keydir/$domain ]] || exit 3 #this should never happen, but you never know.
$editor $keydir/$domain #TODO: if user aborts save in editor, the file is already overwritten