From 60bb54649d64208facc2d22478413e3fd1a7227f Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 24 Aug 2011 16:45:00 +0200 Subject: {btc -> gold} SC & co., we're ready --- gold/mtgox/json_ticker_helper.py | 7 +++++++ gold/mtgox/mtgox.getDepth | 3 +++ gold/mtgox/mtgox.getTrades | 3 +++ gold/mtgox/mtgox.ticker | 4 ++++ gold/mtgox/ticker_text.sh | 3 +++ 5 files changed, 20 insertions(+) create mode 100755 gold/mtgox/json_ticker_helper.py create mode 100755 gold/mtgox/mtgox.getDepth create mode 100755 gold/mtgox/mtgox.getTrades create mode 100755 gold/mtgox/mtgox.ticker create mode 100755 gold/mtgox/ticker_text.sh (limited to 'gold/mtgox') diff --git a/gold/mtgox/json_ticker_helper.py b/gold/mtgox/json_ticker_helper.py new file mode 100755 index 00000000..727dd594 --- /dev/null +++ b/gold/mtgox/json_ticker_helper.py @@ -0,0 +1,7 @@ +#!/usr/bin/python + +import json,sys + +result = json.load(sys.stdin) + +print "High: " + str(result["ticker"]["high"]) + " Low: " + str(result["ticker"]["low"]) + " Last: " + str(result["ticker"]["last"]) diff --git a/gold/mtgox/mtgox.getDepth b/gold/mtgox/mtgox.getDepth new file mode 100755 index 00000000..9a607979 --- /dev/null +++ b/gold/mtgox/mtgox.getDepth @@ -0,0 +1,3 @@ +#! /bin/sh +# get mtgox market depth +$ curl -ksS https://mtgox.com/code/data/getDepth.php diff --git a/gold/mtgox/mtgox.getTrades b/gold/mtgox/mtgox.getTrades new file mode 100755 index 00000000..73e5a68d --- /dev/null +++ b/gold/mtgox/mtgox.getTrades @@ -0,0 +1,3 @@ +#! /bin/sh +# get mtgox last trades +$ curl -ksS https://mtgox.com/code/data/getTrades.phl diff --git a/gold/mtgox/mtgox.ticker b/gold/mtgox/mtgox.ticker new file mode 100755 index 00000000..b24dfb35 --- /dev/null +++ b/gold/mtgox/mtgox.ticker @@ -0,0 +1,4 @@ +#! /bin/sh +# get mtgox ticker data +set -euf +curl -ksS https://mtgox.com/code/data/ticker.php diff --git a/gold/mtgox/ticker_text.sh b/gold/mtgox/ticker_text.sh new file mode 100755 index 00000000..2bcac134 --- /dev/null +++ b/gold/mtgox/ticker_text.sh @@ -0,0 +1,3 @@ +#!/bin/sh +dirname=`dirname $(readlink -f $0)` +$dirname/mtgox.ticker | python $dirname/json_ticker_helper.py -- cgit v1.2.3 From 28fbd9a5f090c52766d0e4ef1014f3356e188656 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 24 Aug 2011 17:01:38 +0200 Subject: gold: add scex ticker_text.sh --- gold/mtgox/json_ticker_helper.py | 7 ------- gold/mtgox/ticker_text.sh | 7 ++++--- 2 files changed, 4 insertions(+), 10 deletions(-) delete mode 100755 gold/mtgox/json_ticker_helper.py (limited to 'gold/mtgox') diff --git a/gold/mtgox/json_ticker_helper.py b/gold/mtgox/json_ticker_helper.py deleted file mode 100755 index 727dd594..00000000 --- a/gold/mtgox/json_ticker_helper.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/python - -import json,sys - -result = json.load(sys.stdin) - -print "High: " + str(result["ticker"]["high"]) + " Low: " + str(result["ticker"]["low"]) + " Last: " + str(result["ticker"]["last"]) diff --git a/gold/mtgox/ticker_text.sh b/gold/mtgox/ticker_text.sh index 2bcac134..f585ffea 100755 --- a/gold/mtgox/ticker_text.sh +++ b/gold/mtgox/ticker_text.sh @@ -1,3 +1,4 @@ -#!/bin/sh -dirname=`dirname $(readlink -f $0)` -$dirname/mtgox.ticker | python $dirname/json_ticker_helper.py +#! /bin/sh +set -euf +cd $(dirname `readlink -f $0`) +./mtgox.ticker | ../json/render/ticker -- cgit v1.2.3