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
- .getLatestBlowWater([page, count]) ⇒
Promise
- .getLatestHot([page, count]) ⇒
Promise
- .getLatestNew([page, count]) ⇒
Promise
- .getChannel(category, [page, count]) ⇒
Promise
- .getThread(threadID, [page, count]) ⇒
Promise
- .search(query, [page, count]) ⇒
Promise
Auth
Thread
Promise
.getLatestBlowWater([page, count]) ⇒ Use this method to get the latest threads in 吹水台.
Param | Type | Description |
---|---|---|
[page] | Number |
default: 1 |
[count] | Number |
default: 30 |
Promise
.getLatestHot([page, count]) ⇒ Use this method to get the latest hot threads.
Param | Type | Description |
---|---|---|
[page] | Number |
default: 1 |
[count] | Number |
default: 30 |
Promise
.getLatestNew([page, count]) ⇒ Use this method to get the latest new threads.
Param | Type | Description |
---|---|---|
[page] | Number |
default: 1 |
[count] | Number |
default: 30 |
Promise
.getChannel(category, [page, count]) ⇒ 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 |
Promise
.getThread(threadID, [page, count]) ⇒ 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 |
Promise
.search(query, [page, count]) ⇒ 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
Promise
.login(email, password) ⇒ Use this method to login. User ID and token is cached for further authentication.
Param | Type | Description |
---|---|---|
String |
username | |
password | String |
password |
Special Thanks
- 連尼住
- HKG+
- 望遠
- https://na.cx
- colloquet
Author
License
lihkg-api-nodejs-client
is available under the MIT license. See the LICENSE file for more info.