From bcd60c0f6d582b708ca77d01c8c7074d61d3b97e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 13 Apr 2010 21:00:33 +0200 Subject: Initial commit: anonbox, kvutils --- anonbox/anonbox.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 anonbox/anonbox.sh (limited to 'anonbox') diff --git a/anonbox/anonbox.sh b/anonbox/anonbox.sh new file mode 100755 index 00000000..db35a5b4 --- /dev/null +++ b/anonbox/anonbox.sh @@ -0,0 +1,45 @@ +#! /bin/bash +#### anonbox.net - anonbox account creator +set -euf + +## +script_begin_date="`date --rfc-3339=ns`" + +## +GET() { + wget --quiet --no-check-certificate -O- https://anonbox.net/en/ +} + +## retrieve data +eval "$(${GET-GET} | + sed -rn ' +s^

([[:alnum:]@.]+)

$\ + email="\1" ; p +s^

.*

$\ + uri="\1" ; p +s^

([0-9]+)/([0-9]+)/([0-9]+) ([0-9]+):([0-9]+) ([ap]).m.

$\ + Y=20\3 ; \ + m=\1 ; \ + d=\2 ; \ + H=\4 ; \ + M=\5 ; \ + p=\6 ; p')" + +## make best-before-date RFC-3339-(seconds)-conform +case "$p" in + p) H="`echo $H+12 | bc`" ;; +esac +s=00 +z=+02:00 +best_before="$Y-$m-$d $H:$M$z" + +## +script_end_date="`date --rfc-3339=ns`" + +## +for key in email uri best_before script_begin_date script_end_date ; do + eval "val=\"\$$key\"" + echo "$key $val" +done + +#### end of file. -- cgit v1.2.3