-
-
Save harrisonhjones/8dcc4788ec49f8dca0f1 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
/*jslint node: true */ | |
"use strict"; | |
// Setup the modules we need to use | |
var spark = require('spark'); | |
var fs = require('fs'); | |
// Login and start doing things! | |
spark.on('login', function() { | |
//Get test event for specific core | |
spark.getEventStream('My Event Name', 'My Core ID', function(data) { | |
console.log("New Event: " + JSON.stringify(data) + ". Logging it to file"); | |
fs.appendFile('myAwesomeLog.txt', data.data + "\n", function (err) { | |
if(err) | |
console.log("File log failure. Error = " + JSON.stringify(err)); | |
else | |
console.log("File log success"); | |
}); | |
}); | |
}); | |
// Login as usual | |
spark.login({ username: 'Myemail@gmail.com', password: 'MyPassword'}); | |
//spark.login({ accessToken: '012345' }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment