lihkg-api-nodejs-client

2.0.1 • Public • Published

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 吹水台.

Param Type Description
[page] Number default: 1
[count] Number default: 30

.getLatestHot([page, count]) ⇒ Promise

Use this method to get the latest hot threads.

Param Type Description
[page] Number default: 1
[count] Number default: 30

.getLatestNew([page, count]) ⇒ Promise

Use this method to get the latest new threads.

Param Type Description
[page] Number default: 1
[count] Number default: 30

.getChannel(category, [page, count]) ⇒ Promise

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

Param Type Description
category Number Refer to Categories
[page] Number default: 1
[count] Number default: 30

.getThread(threadID, [page, count]) ⇒ Promise

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

Param Type Description
threadID Number Thread id returned from the threads list
[page] Number default: 1
[count] Number default: 30

.search(query, [page, count]) ⇒ Promise

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

Param Type Description
query String query string
[page] Number default: 1
[count] Number default: 30

Auth

.login(email, password) ⇒ Promise

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

Param Type Description
email String username
password String password

Special Thanks

Author

@Simon__Li

License

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

Readme

Keywords

Package Sidebar

Install

npm i lihkg-api-nodejs-client

Weekly Downloads

1

Version

2.0.1

License

MIT

Last publish

Collaborators

  • siutsin