Giter VIP home page Giter VIP logo

lihkg-api-nodejs-client's Introduction

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.

lihkg-api-nodejs-client's People

Contributors

siutsin avatar

Watchers

 avatar  avatar

Forkers

jakelauck

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.