aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Sylvester Johansson <scj@archlinux.us>2009-05-22 16:11:17 +0200
committerGravatar Sylvester Johansson <scj@archlinux.us>2009-05-22 16:11:17 +0200
commitc372568af1af5d4ea2afc498d741022207c1de56 (patch)
treec3ce39eb612d0479519e1b65c8584608dee34166 /examples
parentae5ccd70b0170418780509578587cbadbcf636bd (diff)
added form filler script
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/scripts/formfiller.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/scripts/formfiller.sh b/examples/scripts/formfiller.sh
new file mode 100755
index 0000000..006678c
--- /dev/null
+++ b/examples/scripts/formfiller.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# simple login form filler for uzbl.
+# put your login information in the file $keydir/<domain>
+# in the format <fieldname>: <value>
+
+keydir=$XDG_CONFIG_HOME/uzbl/keys
+editor=gvim
+
+config=$1; shift
+pid=$1; shift
+xid=$1; shift
+fifo=$1; shift
+socket=$1; shift
+url=$1; shift
+title=$1; shift
+
+domain=$(echo $url | sed -re 's|(http\|https)+://([A-Za-z0-9\.]+)/.*|\2|')
+if [[ -e $keydir/$domain ]]; then
+ gawk -F': ' '{ print "act script document.getElementsByName(\"" $1 "\")[0].value = \"" $2 "\";"}' $keydir/$domain >> $fifo
+else
+ curl "$url" | grep '<input' | sed -nre 's|.*<input.*?name="([[:graph:]]+)".*?/>.*|\1: |p' > $keydir/$domain
+ $editor $keydir/$domain
+fi