Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:bestng/oauthic-weibo
Browse files Browse the repository at this point in the history
  • Loading branch information
xingrz committed Jul 25, 2013
2 parents 49cbfd0 + ea41688 commit 3812fb8
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
Expand Up @@ -15,7 +15,7 @@ npm install oauthic-weibo

## Quick-start

Authorize:
#### Authorize

```js
require('oauthic-weibo')
Expand All @@ -25,7 +25,7 @@ require('oauthic-weibo')
})
```

Request:
#### Request

```js
var client = require('oauthic-weibo').client(clientInfo)
Expand All @@ -41,14 +41,14 @@ client.get('/statuses/user_timeline.json', function (err, res, timeline) {

Create a new client instance.

Arguments:
#### Arguments

- **clientInfo** Object - Client informations
- **clientId** String - App Key
- **clientScrect** String - App Secret
- **callbackUri** String - URL to be redirected to by the provider.

Returns:
#### Returns

- oauthic.Client - Client instance

Expand All @@ -60,7 +60,7 @@ Client, a wrapped [mikeal/request](https://github.com/mikeal/request) instance.

Build the URL of the authorization page.

Arguments:
#### Arguments

- ***options*** - Additional parameters
- ***scope*** String | Array - Additional scopes. Should be an array or a string separated by `,`
Expand All @@ -73,15 +73,15 @@ Arguments:
- ***forcelogin*** Boolean - Determine whether to force a login.
- ***language*** String - Language of the authorization page. Would be Simplified-Chinese without this parameter. For English set it to `en`.

Returns:
#### Returns

- String - URL of the authorization page

### client.credentical(code, callback)

Get Access Token with an Authorization Code and get ready for making a request.

Arguments:
#### Arguments

- **code** String - Authorization Code
- **callback(err, credentical, userInfo)** Function - Callback
Expand All @@ -94,28 +94,28 @@ Arguments:
- **picture** String - The URL of user's avatar picture
- ...

Returns:
#### Returns

- oauthic.Client - Client instance

### client.token(accessToken[, expiresAt])

Set the Access Token.

Arguments:
#### Arguments

- **accessToken** String - Access Token
- ***expiresAt*** Date | Number - Optional. The time when Access Token expires

Returns:
#### Returns

- oauthic.Client - Client instance

### client.expired(onExpired)

Registers a handler that would be called when the Access Token is expired and could not be refreshed.

Arguments:
#### Arguments

- **onExpired(token)** Function - Handler function
- **token** String - The expired Access Token
Expand All @@ -126,7 +126,7 @@ Wrapped methods from [mikeal/request](https://github.com/mikeal/request). Genera

Actually, Sina Weibo supports GET and POST only, so other methods is not tested or documented.

Errors:
#### Errors

- oauthic.TokenExpiredError - The Access Token is expired and could not be refreshed

Expand All @@ -140,7 +140,7 @@ Returns the current user's Access Token. Useful when you'd prefer building reque

Occurs when the Access Token is expired and could not be refreshed.

Properties:
#### Properties

- **token** String - The expired Access Token

Expand Down

0 comments on commit 3812fb8

Please sign in to comment.