added bizzybotte, cleaned up backup

This commit is contained in:
Jeffrey Paul
2011-07-05 23:29:44 +02:00
parent 3cac5142f1
commit 2627ee4784
3 changed files with 171 additions and 16 deletions

View File

@@ -8,12 +8,25 @@ import decimal
def main(argv):
current = fetch_mtgox_orders()
selling = selling_stats(current['bids'])
buying = buying_stats(current['asks'])
def selling_stats(bids):
high = max([bid[0] for bid in bids])
low = min([bid[0] for bid in bids])
print "highbid %s" % high
print "lowbid %s" % low
def buying_stats(asks):
pass
def fetch_mtgox_orders():
url = 'https://mtgox.com/code/data/getDepth.php'
parsed = json.loads(
urllib.urlopen(url).read(),
parse_float=decimal.Decimal
)
print repr(parsed)
return parsed
sys.exit(main(sys.argv))