Last active
March 16, 2019 16:29
-
-
Save tom-a/2ce5e7f8647f2433bb17916ba4dcb3b4 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
const ambient = require('ambient-lib'); | |
const exec = require('child_process').exec; | |
ambient.connect(チャネルID,'ライトキー'); | |
exec("cat /dev/cuaU0 | head -1", (err,stdout,stderr) => { | |
}); | |
exec("cat /dev/cuaU0 | head -3 | sed '/^$/d' | tail -1", (err,stdout,stderr) => { | |
console.log(stdout); | |
ambient.send({d1: stdout}, (err, res, body) => { | |
if (err) { console.log(err); } | |
console.log(res.statusCode); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment