A nodejs plurk api client library written in ES6.
npm install purakujs --save
import Puraku from 'purakujs';
let client = new Puraku({
consumerKey: CONSUMER_KEY,
consumerSecret: CONSUMER_SECRET
});
client.getRequestToken().then(({oauthToken, oauthTokenSecret}) => {
// open this url in Browser and accept the authentication request
// Plurk then give user a 6-digit pin code
loadURL(`https://www.plurk.com/OAuth/authorize?oauth_token=${oauthToken}`);
// get pin code from user input or redirect url query parameter
let oauthVerifier = getPinCode();
client.getOAuthAccessToken({oauthToken, oauthTokenSecret, oauthVerifier}).then(() => {
// then api client is ready to call api endpoint
client.request('GET', '/APP/Users/me').then(({data}) => {
console.log(data);
});
});
});
npm install
npm run dev
MIT