2.0.1 • Published 7 years ago

lihkg-api-nodejs-client v2.0.1

Weekly downloads
4
License
MIT
Repository
-
Last release
7 years ago

license dependency devDependency Status Build Status Coverage Status

lihkg-api-nodejs-client

LIHKG API client for node.js

Installation

npm install lihkg-api-nodejs-client --save

TL;DR

const lihkg = require('lihkg-api-nodejs-client');
lihkg.getLatestBlowWater().then(result => {
  // threads from 吹水台
}).catch(error => {
  // handle error
});

Usage

Thread

Auth

Thread

.getLatestBlowWater(page, count) ⇒ Promise

Use this method to get the latest threads in 吹水台.

ParamTypeDescription
pageNumberdefault: 1
countNumberdefault: 30

.getLatestHot(page, count) ⇒ Promise

Use this method to get the latest hot threads.

ParamTypeDescription
pageNumberdefault: 1
countNumberdefault: 30

.getLatestNew(page, count) ⇒ Promise

Use this method to get the latest new threads.

ParamTypeDescription
pageNumberdefault: 1
countNumberdefault: 30

.getChannel(category, page, count) ⇒ Promise

Use this method to get the threads in a category(channel).

ParamTypeDescription
categoryNumberRefer to Categories
pageNumberdefault: 1
countNumberdefault: 30

.getThread(threadID, page, count) ⇒ Promise

Use this method to get a thread for the unique ID.

ParamTypeDescription
threadIDNumberThread id returned from the threads list
pageNumberdefault: 1
countNumberdefault: 30

.search(query, page, count) ⇒ Promise

Use this method to search threads contain the query in the title.

ParamTypeDescription
queryStringquery string
pageNumberdefault: 1
countNumberdefault: 30

Auth

.login(email, password) ⇒ Promise

Use this method to login. User ID and token is cached for further authentication.

ParamTypeDescription
emailStringusername
passwordStringpassword

Special Thanks

Author

@Simon__Li

License

lihkg-api-nodejs-client is available under the MIT license. See the LICENSE file for more info.

2.0.1

7 years ago

2.0.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago