Skip to content

Instantly share code, notes, and snippets.

@asherkin
Created March 1, 2016 23:29
Show Gist options
  • Save asherkin/4c6e48cc6c1eddf1cca5 to your computer and use it in GitHub Desktop.
Save asherkin/4c6e48cc6c1eddf1cca5 to your computer and use it in GitHub Desktop.
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