From 7f5321696a2d6f3b8292ab3246f2374ba0334725 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 31 Jul 2011 02:16:15 +0200 Subject: randline: reimplemented --- util/bin/randline | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/util/bin/randline b/util/bin/randline index cd9476e7..75618664 100755 --- a/util/bin/randline +++ b/util/bin/randline @@ -1,12 +1,5 @@ #! /bin/sh -# -# choose a line randomly. -# -set -euf +# Author: tv,makefu +# Info: for old version see commit b9924 -lines="`cat`" -count=`echo "$lines" | wc -l` -random=`od -An -t u8 -N 8 /dev/urandom` -choice=`echo "$random % $count + 1" | bc` - -echo "$lines" | sed -n "${choice}p" +cat | shuf | head -n 1 -- cgit v1.2.3 From 727cf3bbc6bfc08472fc6e0b3784d931ba3391f6 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 31 Jul 2011 02:33:49 +0200 Subject: translate.google: initial commit --- .gitmodules | 3 +++ submodules/github/visionmedia/query | 1 + util/bin/translate.google | 29 +++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 .gitmodules create mode 160000 submodules/github/visionmedia/query create mode 100755 util/bin/translate.google diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..e870b489 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "submodules/github/visionmedia/query"] + path = submodules/github/visionmedia/query + url = https://github.com/visionmedia/query diff --git a/submodules/github/visionmedia/query b/submodules/github/visionmedia/query new file mode 160000 index 00000000..02baed4f --- /dev/null +++ b/submodules/github/visionmedia/query @@ -0,0 +1 @@ +Subproject commit 02baed4f5eb2d22e3ebb0688243c97fe04e7b53d diff --git a/util/bin/translate.google b/util/bin/translate.google new file mode 100755 index 00000000..50d37cc3 --- /dev/null +++ b/util/bin/translate.google @@ -0,0 +1,29 @@ +#! /bin/sh +set -euf + +A=Mozilla +url=http://translate.google.com/ + +{ + for arg; do echo "$arg"; done | sed -rn ' + s/^--(.*=.*)/\1/p;t + s/.*/text="${text+$text }&"/p;t + ' + cat< Date: Sun, 31 Jul 2011 02:36:09 +0200 Subject: translate.google: esnure query is ready --- util/bin/translate.google | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/bin/translate.google b/util/bin/translate.google index 50d37cc3..56cd7ee0 100755 --- a/util/bin/translate.google +++ b/util/bin/translate.google @@ -4,6 +4,11 @@ set -euf A=Mozilla url=http://translate.google.com/ +pwd="$(dirname "$(readlink -f "$0")")" + +# ensure query is ready +(cd "$pwd/../.." && git submodule update --init) + { for arg; do echo "$arg"; done | sed -rn ' s/^--(.*=.*)/\1/p;t @@ -11,7 +16,7 @@ url=http://translate.google.com/ ' cat< Date: Sun, 31 Jul 2011 02:38:32 +0200 Subject: add mtgox' public API --- btc/mtgox/mtgox.getDepth | 3 +++ btc/mtgox/mtgox.getTrades | 3 +++ btc/mtgox/mtgox.ticker | 4 ++++ 3 files changed, 10 insertions(+) create mode 100755 btc/mtgox/mtgox.getDepth create mode 100755 btc/mtgox/mtgox.getTrades create mode 100755 btc/mtgox/mtgox.ticker diff --git a/btc/mtgox/mtgox.getDepth b/btc/mtgox/mtgox.getDepth new file mode 100755 index 00000000..7401d532 --- /dev/null +++ b/btc/mtgox/mtgox.getDepth @@ -0,0 +1,3 @@ +#! /bin/sh +# get mtgox market depth +wget -qO- http://mtgox.com/code/data/getDepth.php diff --git a/btc/mtgox/mtgox.getTrades b/btc/mtgox/mtgox.getTrades new file mode 100755 index 00000000..4901e379 --- /dev/null +++ b/btc/mtgox/mtgox.getTrades @@ -0,0 +1,3 @@ +#! /bin/sh +# get mtgox last trades +wget -qO- http://mtgox.com/code/data/getTrades.php diff --git a/btc/mtgox/mtgox.ticker b/btc/mtgox/mtgox.ticker new file mode 100755 index 00000000..bbfcc52d --- /dev/null +++ b/btc/mtgox/mtgox.ticker @@ -0,0 +1,4 @@ +#! /bin/sh +# get mtgox ticker data +set -euf +wget -qO- http://mtgox.com/code/data/ticker.php -- cgit v1.2.3 From ab443d56b7deb3a5c87122d000293aa19eb3f760 Mon Sep 17 00:00:00 2001 From: club-mate Date: Sun, 31 Jul 2011 02:48:58 +0200 Subject: add User-Agent database --- db/User-Agent.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 db/User-Agent.txt diff --git a/db/User-Agent.txt b/db/User-Agent.txt new file mode 100644 index 00000000..3ed1f91f --- /dev/null +++ b/db/User-Agent.txt @@ -0,0 +1,19 @@ +Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50215; .NET CLR 3.0.0450 +Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Trident/4.0; SV1; SpamBlockerUtility 4.7.5) +Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp) +Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; GTB6.4; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0. +Mozilla/5.0 (Linux; U; Android 1.5; fr-fr, HTC Hero Build/CUPCAKE) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3/5/9 +Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9 +Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB0.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.3 +Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 +Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) +Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9 (.NET CLR 3.5.30729) +Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 +Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2) +Opera/9.80 (Windows NT 5.1; U; en) Presto/2.5.22 Version/10.50 +Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR +Opera/9.80 (Macintosh; PPC Mac OS X; U; en) Presto/2.2.15 Version/10.10 +Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR +Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 +Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727) +Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9 (.NET CLR 3.5.30729) -- cgit v1.2.3 From 1ac4991f804d560fbbe92f121073d69642bf139d Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 31 Jul 2011 03:22:00 +0200 Subject: translate.google: add all the submodules --- util/bin/translate.google | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/util/bin/translate.google b/util/bin/translate.google index 56cd7ee0..943675f4 100755 --- a/util/bin/translate.google +++ b/util/bin/translate.google @@ -6,6 +6,15 @@ url=http://translate.google.com/ 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) @@ -22,7 +31,6 @@ pwd="$(dirname "$(readlink -f "$0")")" -d "js=\${js-n}" \\ -d "prev=\${prev-_t}" \\ -d "hl=\${hl-en}" \\ - -d "ie=\${ie-UTF-8}" \\ -d "layout=\${layout-2}" \\ -d "eotf=\${eotf-1}" \\ -d "sl=\${sl-auto}" \\ -- cgit v1.2.3 From 28d0988503094cb9f7e3885b55240fba2686da2c Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 31 Jul 2011 03:37:24 +0200 Subject: tranlate.google: add even more submodules --- .gitmodules | 12 ++++++++++++ submodules/github/NV/cssom | 1 + submodules/github/mikeal/request | 1 + submodules/github/tautologistics/node-htmlparser | 1 + submodules/github/tmpvar/jsdom | 1 + 5 files changed, 16 insertions(+) create mode 160000 submodules/github/NV/cssom create mode 160000 submodules/github/mikeal/request create mode 160000 submodules/github/tautologistics/node-htmlparser create mode 160000 submodules/github/tmpvar/jsdom diff --git a/.gitmodules b/.gitmodules index e870b489..ed0cb4ed 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,15 @@ [submodule "submodules/github/visionmedia/query"] path = submodules/github/visionmedia/query url = https://github.com/visionmedia/query +[submodule "submodules/github/tmpvar/jsdom"] + path = submodules/github/tmpvar/jsdom + url = https://github.com/tmpvar/jsdom +[submodule "submodules/github/mikeal/request"] + path = submodules/github/mikeal/request + url = https://github.com/mikeal/request.git +[submodule "submodules/github/NV/cssom"] + path = submodules/github/NV/cssom + url = https://github.com/NV/CSSOM +[submodule "submodules/github/tautologistics/node-htmlparser"] + path = submodules/github/tautologistics/node-htmlparser + url = https://github.com/tautologistics/node-htmlparser diff --git a/submodules/github/NV/cssom b/submodules/github/NV/cssom new file mode 160000 index 00000000..dacc6c3c --- /dev/null +++ b/submodules/github/NV/cssom @@ -0,0 +1 @@ +Subproject commit dacc6c3c9dc9676f68df056a44a0d5f92884cc01 diff --git a/submodules/github/mikeal/request b/submodules/github/mikeal/request new file mode 160000 index 00000000..c99b8fcd --- /dev/null +++ b/submodules/github/mikeal/request @@ -0,0 +1 @@ +Subproject commit c99b8fcd706ae035f6248669b017ac2995e45f31 diff --git a/submodules/github/tautologistics/node-htmlparser b/submodules/github/tautologistics/node-htmlparser new file mode 160000 index 00000000..d770be59 --- /dev/null +++ b/submodules/github/tautologistics/node-htmlparser @@ -0,0 +1 @@ +Subproject commit d770be592d81d6b603d6197dc727ce89ad195d0a diff --git a/submodules/github/tmpvar/jsdom b/submodules/github/tmpvar/jsdom new file mode 160000 index 00000000..30bac996 --- /dev/null +++ b/submodules/github/tmpvar/jsdom @@ -0,0 +1 @@ +Subproject commit 30bac996077fb0096ff2334f0e13939586ae31b2 -- cgit v1.2.3 From 3a202fe94eff7b68fa3ffdac35caabf5ee815284 Mon Sep 17 00:00:00 2001 From: club-mate Date: Sun, 31 Jul 2011 03:50:12 +0200 Subject: mtgox: s/wget/curl/g --- btc/mtgox/mtgox.getDepth | 2 +- btc/mtgox/mtgox.getTrades | 2 +- btc/mtgox/mtgox.ticker | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/btc/mtgox/mtgox.getDepth b/btc/mtgox/mtgox.getDepth index 7401d532..effc28a0 100755 --- a/btc/mtgox/mtgox.getDepth +++ b/btc/mtgox/mtgox.getDepth @@ -1,3 +1,3 @@ #! /bin/sh # get mtgox market depth -wget -qO- http://mtgox.com/code/data/getDepth.php +$ curl -ksS http://mtgox.com/code/data/getDepth.php diff --git a/btc/mtgox/mtgox.getTrades b/btc/mtgox/mtgox.getTrades index 4901e379..fd0d0ea9 100755 --- a/btc/mtgox/mtgox.getTrades +++ b/btc/mtgox/mtgox.getTrades @@ -1,3 +1,3 @@ #! /bin/sh # get mtgox last trades -wget -qO- http://mtgox.com/code/data/getTrades.php +$ curl -ksS http://mtgox.com/code/data/getTrades.phl diff --git a/btc/mtgox/mtgox.ticker b/btc/mtgox/mtgox.ticker index bbfcc52d..54a150f0 100755 --- a/btc/mtgox/mtgox.ticker +++ b/btc/mtgox/mtgox.ticker @@ -1,4 +1,4 @@ #! /bin/sh # get mtgox ticker data set -euf -wget -qO- http://mtgox.com/code/data/ticker.php +curl -ksS http://mtgox.com/code/data/ticker.php -- cgit v1.2.3 From 554c90e8456f44ac82ac3d64f3c31f0ac93cac8d Mon Sep 17 00:00:00 2001 From: club-mate Date: Sun, 31 Jul 2011 04:12:02 +0200 Subject: mtgox: s/http/https/g --- btc/mtgox/mtgox.getDepth | 2 +- btc/mtgox/mtgox.getTrades | 2 +- btc/mtgox/mtgox.ticker | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/btc/mtgox/mtgox.getDepth b/btc/mtgox/mtgox.getDepth index effc28a0..9a607979 100755 --- a/btc/mtgox/mtgox.getDepth +++ b/btc/mtgox/mtgox.getDepth @@ -1,3 +1,3 @@ #! /bin/sh # get mtgox market depth -$ curl -ksS http://mtgox.com/code/data/getDepth.php +$ curl -ksS https://mtgox.com/code/data/getDepth.php diff --git a/btc/mtgox/mtgox.getTrades b/btc/mtgox/mtgox.getTrades index fd0d0ea9..73e5a68d 100755 --- a/btc/mtgox/mtgox.getTrades +++ b/btc/mtgox/mtgox.getTrades @@ -1,3 +1,3 @@ #! /bin/sh # get mtgox last trades -$ curl -ksS http://mtgox.com/code/data/getTrades.phl +$ curl -ksS https://mtgox.com/code/data/getTrades.phl diff --git a/btc/mtgox/mtgox.ticker b/btc/mtgox/mtgox.ticker index 54a150f0..b24dfb35 100755 --- a/btc/mtgox/mtgox.ticker +++ b/btc/mtgox/mtgox.ticker @@ -1,4 +1,4 @@ #! /bin/sh # get mtgox ticker data set -euf -curl -ksS http://mtgox.com/code/data/ticker.php +curl -ksS https://mtgox.com/code/data/ticker.php -- cgit v1.2.3