Skip to content
A node.js client for newsmth.net. 水木社区的node.js client.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.npmignore
README.md
index.js
package.json

README.md

node-kbs

KBS BBS的node.js客户端,目前支持北邮人论坛以及水木社区。

安装

npm install node-kbs

注意

由于使用了ECMA Script 6th Edition的功能,因此必须node版本大于v0.11,并在运行时使用--harmony参数。

使用方法

var co = require('co'),
    api = require('node-kbs').getClient('smth');

co(function *() {
  yield api.login('guest', 'foobar');

  var auth = api.getAuthToken();
  ap.setAuthToken(auth);

  console.log(yield yield api.queryUser());
  console.log(yield yield api.queryUser('ttl'));

  console.log(yield api.getTop10());
  console.log(yield api.getBoard('Skate'));
  console.log(yield api.getFavorite(0));
  console.log(yield api.getThread('Skate', '715940');
})();
Something went wrong with that request. Please try again.