Skip to content

Instantly share code, notes, and snippets.

@cronopio
Created September 13, 2011 22:32
Show Gist options
  • Save cronopio/1215374 to your computer and use it in GitHub Desktop.
Save cronopio/1215374 to your computer and use it in GitHub Desktop.
Playing with hook.io
gmon.out
node_modules/
{
"name":"testHookio",
"version": "0.0.1",
"dependencies": {
"hook.io-request": "0.3.x"
}
}
#!/usr/bin/env node
var RequestHook = require('hook.io-request').RequestHook;
var test = new RequestHook({
name: "mtgox",
debug:true
});
test.on('hook::ready', function(){
test.emit('*::sendRequest', {"url":"https://mtgox.com/api/0/data/ticker.php","headers":{
"User-Agent": "Hook.IO-Script/0.1"
}});
});
test.on('gotResponse', function(data){
console.log ('Ticker MtGox');
console.log(data.body);
});
test.start();
@Marak
Copy link

Marak commented Sep 14, 2011

FYI, new Hook.emit api supports callbacks. I'll need to tweak hook.io-request slightly, but it will be very easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment