0.1.0 • Published 8 years ago

purakujs v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

purakujs - a nodejs plurk api client library in ES6

npm version

A nodejs plurk api client library written in ES6.

Install

npm install purakujs --save

Usage

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(`http://www.plurk.com/OAuth/authorize?oauth_token=${oauthToken}`);

  // get pin code from user input or some injected script
  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);
    });
  });
});

Development

npm install
npm run dev

License

MIT

0.1.0

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago