Created
March 1, 2016 23:29
-
-
Save asherkin/4c6e48cc6c1eddf1cca5 to your computer and use it in GitHub Desktop.
This file contains 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 SteamCommunity = require('steamcommunity'); | |
var http = require('http'); | |
var steam = new SteamCommunity(); | |
steam.login({ | |
accountName: '[redacted]', | |
password: '[redacted]', | |
steamguard: '[redacted]', | |
}, function(err) { | |
if (err) throw err; | |
console.log('Logged in!'); | |
steam.chatLogon(); | |
steam.on('chatLoggedOn', function() { | |
console.log('Logged into chat!'); | |
}); | |
steam.on('chatMessage', function() { | |
console.log('Chat message!'); | |
var req = http.request({ | |
host: '192.168.0.11', | |
port: 80, | |
path: '/api/[redacted]/lights/4/state', | |
method: 'PUT', | |
}, function(res) { | |
console.log('Request sent!'); | |
}); | |
req.on('error', function() {}); | |
req.write(JSON.stringify({ alert: 'select' })); | |
req.end(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment