Last active
December 14, 2016 15:43
-
-
Save potato4d/52fa602a030eaebde96721b962d4cbfa to your computer and use it in GitHub Desktop.
electron-oauth-twitterでElectronでのTwitter OAuth認証を手軽に行う ref: http://qiita.com/potato4d/items/a4a2c9cb5667135f0748
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
const dialog = require('electron').dialog; | |
const OauthTwitter = require('electron-oauth-twitter'); | |
const twitter = new OauthTwitter({ | |
key : "YOUR_TWITTER_KEY", | |
secret: "YOUR_TWITTER_SECRET", | |
}); | |
twitter.startRequest() | |
.then((result) => { | |
dialog.showErrorBox('Status', 'Token: ' + result.oauth_access_token + '\nSecret: ' + result.oauth_access_token_secret); | |
}).catch((error) => { | |
console.error(error, error.stack); | |
}); |
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
$ npm i -S electron-oauth-twitter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment