summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authortv <tv@also>2011-08-05 23:57:46 +0200
committertv <tv@also>2011-08-05 23:57:46 +0200
commitb7f3e74127aa55b6687cc30c0decf0f76791ddf4 (patch)
treed38b74f86c46053f6439c3483513a2c3b8a796b1 /util
parentd492547e762353c9b75cc9c0b7aca6f049695ef2 (diff)
parentc06d2bfb78682f4e72966274d7185c41d7309bbd (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'util')
-rwxr-xr-xutil/bin/galileo2
-rwxr-xr-xutil/bin/wiki.firstpar23
2 files changed, 25 insertions, 0 deletions
diff --git a/util/bin/galileo b/util/bin/galileo
new file mode 100755
index 00000000..8ca7d834
--- /dev/null
+++ b/util/bin/galileo
@@ -0,0 +1,2 @@
+#!/bin/sh
+./wiki.firstpar http://de.m.wikipedia.org/wiki/::Random | xargs ./naturalvoices.att
diff --git a/util/bin/wiki.firstpar b/util/bin/wiki.firstpar
new file mode 100755
index 00000000..d2181f1b
--- /dev/null
+++ b/util/bin/wiki.firstpar
@@ -0,0 +1,23 @@
+#! /bin/bash
+set -euf
+
+A=Mozilla
+
+pwd="$(dirname "$(readlink -f "$0")")"
+
+for x in \
+ "$pwd/../../submodules/github/tmpvar" \
+ "$pwd/../../submodules/github/mikeal" \
+ "$pwd/../../submodules/github/NV" \
+ "$pwd/../../submodules/github/tautologistics" \
+; do
+ export NODE_PATH="`readlink -f "$x"`${NODE_PATH+:$NODE_PATH}"
+done
+
+# ensure query is ready
+(cd "$pwd/../.." && git submodule update --init)
+
+query() {
+ node "$(readlink -f "$pwd/../../submodules/github/visionmedia/query")" "$@"
+}
+curl -b redirect=seen -L -e http://de.wikipedia.org/wiki/$RANDOM -sS -A "\${A-Mozilla}" "$1" | query 'p' 'first' |w3m -T text/html -dump| cut -c -750