Skip to content

Instantly share code, notes, and snippets.

@diorahman
Created July 12, 2012 02:23
Show Gist options
  • Save diorahman/3095263 to your computer and use it in GitHub Desktop.
Save diorahman/3095263 to your computer and use it in GitHub Desktop.
Running sns
var spawn = require('child_process').spawn,
// arguments -> type username password (scope)
/*
types ={
gplus : 0
facebook : 1
twitter : 2
}
facebook -> spawn('./sns', ['1', '[email protected]', 'dio10201', 'email, publish_stream'])
g+ -> spawn('./sns', ['0', '[email protected]', 'dio10201'])
twitter -> spawn('./sns', ['0', 'aegislabs', 'aegis10201'])
*/
child = spawn('./sns', ['0', '[email protected]', 'dio10201'])
child.stdout.on('data', function (data) {
var obj = JSON.parse(data)
console.log('token: ' + obj['access_token'])
});
child.on('exit', function (code) {
console.log('child process exited with code ' + code);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment