Constructor
Consumer token, can be obtain one from Plurk App console.
Consumer token secret, should be together with consumer token.
Oauth access token, optional.
You may assign it here or use getRequestToken()
and then getAccessToken()
to obtain one from user with oauth authentication flow.
Oauth access token secret, optional. Also this should be come with access token.
Flag indicates if the commet channel is started.
Consumer token, can be obtain one from Plurk App console.
Consumer token secret, should be together with consumer token.
Boolean field, set to true
to automatic stops the
comet channel when any error has been thrown,
or else it will keep reconnect even have errors.
OAuth access token or request token of current client.
OAuth token secret of current client.
User authentication URL. Should be inform user to navigate to this URL
once the promise of getRequestToken(...)
has been resolved.
Mobile version of user authentication URL.
Users may navigate to this URL instead of authPage
if they are using smartphones.
Get oauth access token (permanent) for requesting other API.
It will assigns token
and tokenSecret
of current instance.
Should be called once users' verifier has been received.
The oauth verifier received from the user.
Current plurk client instance.
Get oauth request token (temporary) for user to authenticate.
It will assigns token
and tokenSecret
of current instance for further process.
Redirect URL after authenticate success, can be omitted if this is not a web app.
Current plurk client instance.
Restart long poll from comet channel. Normally this method is automatically called while polling.
Make a post request API call to Plurk (as recommended in the documentation), it will uses the oauth token provided in the client instance if available. Plurk API Reference
API path as written in the documentation.
APP/
prefix can be omitted.
Object hash of the parameters, can be omitted if no parameters.
Also it will automatically converts Date
object entries to
ISO8601 string and
Array
object entries to JSON string before request.
You may also pass Node.js native Buffer
or Stream
values for image uploading APIs
such as /APP/Timeline/uploadPicture
.
The parsed JSON data respond from Plurk.
It will auto converts all known date/time fields to Date
objects
and limited_to
field to array of numbers.
Start long poll from comet channel, it auto handles request for comet server URL and it will auto keep polling until you stops it.
Stops long poll from comet channel.
Generated using TypeDoc
PlurkClient
is a class that wraps all plurk API call and handles comet channel when enabled. It inherits from Node.js's EventEmitter class.