Created
February 27, 2015 16:23
-
-
Save chrismatthieu/abdd54699ef11d70e916 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
// }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?