From 57d2b4a2fa034c9c87ff5b4c04ceaabf86b4842e Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 5 Aug 2011 21:20:13 +0200 Subject: wiki.firstpar: initial commit of galileo --- util/bin/wiki.firstpar | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 util/bin/wiki.firstpar (limited to 'util/bin') diff --git a/util/bin/wiki.firstpar b/util/bin/wiki.firstpar new file mode 100755 index 00000000..df66f707 --- /dev/null +++ b/util/bin/wiki.firstpar @@ -0,0 +1,23 @@ +#! /bin/sh +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 -sS -A "\${A-Mozilla}" "$1" | query 'p' 'first' | w3m -T text/html -dump -- cgit v1.2.3 From af257d3f13e66b15e3940b734a13156d8da61b11 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 5 Aug 2011 22:20:32 +0200 Subject: added galileo --- util/bin/galileo | 2 ++ util/bin/wiki.firstpar | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100755 util/bin/galileo (limited to 'util/bin') 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 index df66f707..d2181f1b 100755 --- a/util/bin/wiki.firstpar +++ b/util/bin/wiki.firstpar @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash set -euf A=Mozilla @@ -15,9 +15,9 @@ for x in \ done # ensure query is ready -#(cd "$pwd/../.." && git submodule update --init) +(cd "$pwd/../.." && git submodule update --init) query() { node "$(readlink -f "$pwd/../../submodules/github/visionmedia/query")" "$@" } -curl -sS -A "\${A-Mozilla}" "$1" | query 'p' 'first' | w3m -T text/html -dump +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 -- cgit v1.2.3