Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@

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

- [hook.io](http://hook.io)
- [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
Expand All @@ -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)
Empty file modified bin/mtgox
100644 → 100755
Empty file.
16 changes: 8 additions & 8 deletions bin/ticker
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]
}
}
4 changes: 2 additions & 2 deletions lib/mtgox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down