summaryrefslogtreecommitdiffstats
path: root/gold/bitcoinwisdom/beep.js
diff options
context:
space:
mode:
authortv <tv@nomic.retiolum>2013-11-07 13:07:25 +0100
committertv <tv@nomic.retiolum>2013-11-07 13:07:25 +0100
commit03d7962c7346cb5aa09466c763a2010d89eb7d45 (patch)
treecf0feaf3a6d8fb077ba5672aaeeb58ef14a980ff /gold/bitcoinwisdom/beep.js
parentea8a9e3f3637eb2cd6f1781afe20d9f0c4090fed (diff)
bitcoinwisdom ticker: initial commit
Diffstat (limited to 'gold/bitcoinwisdom/beep.js')
-rw-r--r--gold/bitcoinwisdom/beep.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/gold/bitcoinwisdom/beep.js b/gold/bitcoinwisdom/beep.js
new file mode 100644
index 00000000..80a0cb0f
--- /dev/null
+++ b/gold/bitcoinwisdom/beep.js
@@ -0,0 +1,30 @@
+module.exports = {
+ create_beeper: create_beeper,
+}
+
+var child_process = require('child_process');
+
+function create_beeper (spec) {
+ return {
+ beep: beep,
+ }
+ function beep (freq, len) {
+ var child = child_process.spawn('beep', [
+ '-f', freq,
+ '-l', len,
+ ]);
+ child.stdout.on('data', function (data) {
+ console.log('stdout: ' + data);
+ });
+
+ child.stderr.on('data', function (data) {
+ console.log('stderr: ' + data);
+ });
+
+ child.on('close', function (code) {
+ if (code !== 0) {
+ console.log('child process exited with code ' + code);
+ }
+ });
+ }
+}