Skip to content

Instantly share code, notes, and snippets.

@chrismatthieu
Created February 27, 2015 16:23
Show Gist options
  • Save chrismatthieu/abdd54699ef11d70e916 to your computer and use it in GitHub Desktop.
Save chrismatthieu/abdd54699ef11d70e916 to your computer and use it in GitHub Desktop.
var request = require("request");
// var tessel = require('tessel');
// var led1 = tessel.led[0].output(0);
console.log("connecting to skynet");
request.get('http://skynet.im/subscribe',
{headers: {
'skynet_auth_uuid': '196798f1-b5d8-45a0c0308eaa',
'skynet_auth_token': '00cpk8akrmhe0358livn29'
}}
, function (error, response, body) {
console.log(body);
var data = JSON.parse(body);
// res.json(data);
console.log("blinking led!");
// Toggle the led states
// led1.toggle();
});
console.log("ended");
// request.post('http://skynet.im/messages',
// {form: {"devices": req.body.toUuid,
// "subdevice": req.body.message.subdevice,
// "payload": req.body.message.payload}
// , headers: {
// 'skynet_auth_uuid': 'd4d49501-f441-039ac005852a',
// 'skynet_auth_token': '0s7d03t0ndcnuwc9xusor'
// }}
// , function (error, response, body) {
// console.log(body);
// var data = JSON.parse(body);
// res.json(data);
// });
@brianehlert
Copy link

This looks to be node.js to me.
So help me here, I see the subscribe as a get. And I see a commented out post.
What was the scenario for the snippet?

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