Created
July 12, 2012 02:23
-
-
Save diorahman/3095263 to your computer and use it in GitHub Desktop.
Running sns
This file contains hidden or 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
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