summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name <you@example.com>2013-02-22 23:07:09 +0000
committerYour Name <you@example.com>2013-02-22 23:07:09 +0000
commitd3e60d8fac6315692f64d52f1eec55511341e7cf (patch)
treea7bb37d3c2b5375d80ca056bc779f125ead419a2
parent24127b4e7fdd4c73b326a452e700fbb6c6dce336 (diff)
parent1ca9360f5a35d0c2ee5876bba85f2ead44e5a540 (diff)
Merge branch 'master' of https://github.com/krebscode/painload
-rwxr-xr-xutil/bin/dict.leo.org87
1 files changed, 0 insertions, 87 deletions
diff --git a/util/bin/dict.leo.org b/util/bin/dict.leo.org
deleted file mode 100755
index 03f16b96..00000000
--- a/util/bin/dict.leo.org
+++ /dev/null
@@ -1,87 +0,0 @@
-#! /bin/sh
-#### dict.leo.org version 2.0 beta 1
-set -euf
-
-cache_dir=/tmp/dict.leo.org/
-file="$cache_dir$*"
-
-url="http://dict.leo.org/?$*"
-
-# TODO check sanity of filename
-
-if test -d "$cache_dir" ; then
- test -e "$file" || { curl --silent "$url" | tee "$file" ; }
-else
- curl --silent "$url"
-fi |
-sed 's/>\( *.\)/>\n\1/g' | sed -n '
- s/[[:space:]]/ /g
- /<!-- # Werbung # -->/,/<\/td>/b
- /<!-- ============================================== -->/,/^<\/td>/b
- /<!-- # Trailer # -->/,/^ <\/table>/b
- /<table id="subnavigation" class="border">/,/<\/table>/b
- /<div id="divMoreInfo" class="popup">/,/^ <\/table>/b
-
- ## show link in rendered version
- s/^<a href="\(.*searchLocRelinked.*\)">$/&mehr: \1/
- s/^mehr &gt;&gt;//
-
- s/<[Bb][Rr] *\/>/,/g
-
- p
- b
- :c;# comment
- s/-->/\\-\\-\\>/g
- s/<!--/\\<\\!\\-\\-/g
- s/.*/<!--(&)-->/
- p
-' \
-| w3m -cols 1024 -T text/html -dump | sed '
- s/[[:space:]]\+/ /g
- s/ ,/,/g
- s/^ //;s/ $//
- s/[┌┬┐└┴┘├┼┤─]//g
- s/ *│ */|/g
- s/\[ \]//
- s/\[Speichern\] der ausgewa:hlten Wo:rter im Trainer//
- s/^||//;s/|| \?$//
-' | sed -n '
- /^\[EN-> DE\]/,$b
- s/^mehr: /+ /
- s/^ENGLISCH||DEUTSCH \?/= Englisch -> Deutsch/
- s/^|\([0-9]\+\) \(Treffer\)|$/= \1 \2/
- s/^\([^|]\+\)||\([^|]\+\)$/- \1|\2/
-
- s/^[^=+#-][^|]\+$/## &/
-
- p
-' | sed -n '
- /^$/b
- s/ \([?!]\)/\1/g
- s/\([[(]\) /\1/g;s/ \([]\)]\)/\1/g
-
- s/ ([0-9]\+ of [0-9]\+) \?//;# TODO
-
- #s/^##.*Grundform.*/\n#&/
- /^## .*Grundform.*/,/^##\( .*\)\?/{
- /##/{/Grundform/!p}
- b
- }
-
- /^## Informationen /,$b;# TODO
- #/^## Beispiele/,$b;# TODO
- #/^## Wendungen/,$b;# TODO
- /^+/b;# TODO
- #/^=/b;# TODO
-
- p
-' | sed '
- ##
- s/|\(.*\)/\n \1/g
- s/^#.*/\n&/
-
- s/##.*Treffer $/\n#&/
-' | less -R
-echo
-
-#### end of file.