Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Updated to work with my hook.io-ws branch and to new mtgox apis #1

Open
wants to merge 2 commits into from

1 participant

@polidore

Just a proof of concept, and not ready for npm until the socket.io stuff gets pulled by learnboost.

polidore added some commits
@polidore polidore I'm using my own branch of hook.io-ws which uses socket.io-client and
can now connect to the new mtgox https websocket server.  Also, i fixed
some bugs in the main mtgix.js that are due to API changes by mtgox.
0abe4a3
@polidore polidore added instructions for using this with my other branches. 985b522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 24, 2011
  1. @polidore

    I'm using my own branch of hook.io-ws which uses socket.io-client and

    polidore authored
    can now connect to the new mtgox https websocket server.  Also, i fixed
    some bugs in the main mtgix.js that are due to API changes by mtgox.
  2. @polidore
This page is out of date. Refresh to see the latest.
View
16 README.md
@@ -2,6 +2,9 @@
Hook from mtgox to integrate with the rest of hook.io ecosystem
+This is a branch to fix some inconsistencies with new mtgox api such as https server and to use my branch of hook.io-ws.
+
+Notice local npm installs.
### Dependencies
@@ -9,10 +12,15 @@ Hook from mtgox to integrate with the rest of hook.io ecosystem
- [hook.io-ws](http://github.com/cronopio/hook.io-ws)
### Installation
- git clone git://github.com/cronopio/hook.io-mtgox.git
- cd hook.io-mtgox
+ git clone git://github.com/polidore/hook.io-mtgox.git
+ git clone git://github.com/polidore/hook.io-ws.git
+ cd hook.io-ws
+ git submodule init
+ git submodule update
+ cd ../hook.io-mtgox
npm install hook.io
- npm install hook.io-ws
+ npm install ../hook.io-ws
+ npm install ../hook.io-ws/3rd/socket.io-client
### Runing
cd hook.io-mtgox
@@ -22,4 +30,4 @@ Hook from mtgox to integrate with the rest of hook.io ecosystem
![Screenshot1](http://i.imgur.com/Zilic.jpg)
Is possible set verbose with `-v` or `--verbose` to see the changes to the order book
-![Screenshot2](http://i.imgur.com/n5rbE.jpg)
+![Screenshot2](http://i.imgur.com/n5rbE.jpg)
View
0  bin/mtgox 100644 → 100755
File mode changed
View
16 bin/ticker 100644 → 100755
@@ -69,7 +69,7 @@ var renderChange = function(depth){
}
msg += data.type_str.bold;
msg += ' '+vol.yellow + ' @ '.italic + data.price.green;
- console.log(msg);
+ //console.log(msg);
};
var renderTrade = function(trade,last){
@@ -102,20 +102,20 @@ var renderTrade = function(trade,last){
msg += money;
}
- console.log(msg.bold);
+ //console.log(msg.bold);
};
var renderTicker = function(tick,last){
var data = tick.ticker;
- var lineOne = ' Volume: ' + data.vol.toString().red;
- lineOne += ' Last Price: ' + last.toString().green.bold;
+ var lineOne = ' Volume: ' + data.vol.display.red;
+ lineOne += ' Last Price: ' + data.last.display.green.bold;
- var lineTwo = ' Buy: ' + data.buy.toString().bold;
- lineTwo += ' Sell: ' + data.sell.toString().bold;
+ var lineTwo = ' Buy: ' + data.buy.display.bold;
+ lineTwo += ' Sell: ' + data.sell.display.bold;
- var lineThree = ' | Max: ' + data.high.toString().italic;
- lineThree += ' Min: ' + data.low.toString().italic;
+ var lineThree = ' | Max: ' + data.high.display.italic;
+ lineThree += ' Min: ' + data.low.display.italic;
console.log(lineOne);
console.log(lineTwo,lineThree);
View
2  config.json
@@ -4,4 +4,4 @@
{"key":"d5f06780-30a8-4a48-a2f8-7ed181b4a13f", "name":"MtGox Tick", "private": "ticker"},
{"key":"24e67e0d-1cad-4cc0-9e7a-f8523ef460fe", "name":"All Market", "private":"depth"}
]
-}
+}
View
4 lib/mtgox.js
@@ -14,8 +14,8 @@ var MtgoxHook = exports.MtgoxHook = function(options){
self.spawn([{
"name": "mtgox-ws-hook",
"type": "ws",
- "debug": "false",
- "url": "ws://websocket.mtgox.com/mtgox"
+ "debug": false,
+ "url": "https://socketio.mtgox.com/mtgox"
}], function(err){
// spawn ready
self.on('*::websocket::message',function(message){
Something went wrong with that request. Please try again.