commit 3c0444fc5d1505a202ec58f9043a04c094771a68 Author: Lucas Pleß Date: Mon Dec 17 14:58:03 2012 +0100 added fetcher app diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/cosmfetcher.js b/cosmfetcher.js new file mode 100644 index 0000000..17081e3 --- /dev/null +++ b/cosmfetcher.js @@ -0,0 +1,36 @@ +var assert = require('assert'); +var restify = require('restify'); +var osc = require('node-osc'); + +var streams = [ 91755, 70632 ]; + +var oscclient = new osc.Client('127.0.0.1',5001); + +var client = restify.createJsonClient({ + url: 'http://api.cosm.com', + headers: { 'X-ApiKey': 'orKBBdLAKuKJU-RxqmZpZB6q0baSAKxBTVhKdjhUNkdyVT0g' }, + version: '*' +}); + +var fubs = function() { + for(var i=0;i 2 ? process.argv[2] : '5001'; + +var oscServer = new osc.Server(port, '0.0.0.0'); +oscServer.on("message", function (msg, rinfo) { + console.log("message: " + msg); +}); diff --git a/readme b/readme new file mode 100644 index 0000000..ed1b6f7 --- /dev/null +++ b/readme @@ -0,0 +1,6 @@ +install nodejs and npm + +install node packages with npm + +npm install node-osc restify + diff --git a/testhub.js b/testhub.js new file mode 100644 index 0000000..867e356 --- /dev/null +++ b/testhub.js @@ -0,0 +1,16 @@ +var osc = require('node-osc'); + +var port = process.argv.length > 2 ? process.argv[2] : '5001'; + +var sender1 = new osc.Client('127.0.0.1', 6001); +var sender2 = new osc.Client('127.0.0.1', 6002); +var sender3 = new osc.Client('127.0.0.1', 6003); +var sender4 = new osc.Client('127.0.0.1', 6004); + +var receiver = new osc.Server(port, '0.0.0.0'); +receiver.on("message", function (msg, rinfo) { + sender1.send(msg[0],msg[1]); + sender2.send(msg[0],msg[1]); + sender3.send(msg[0],msg[1]); + sender4.send(msg[0],msg[1]); +});