duoshuo
duoshuo SDK based on Node.js
Last updated 5 years ago by turing .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install duoshuo 
SYNC missed versions from official npm registry.

duoshuo duoshuo.com apis npm

duoshuo.com apis for node.js

How to install

$ npm install duoshuo

Sample code

var Duoshuo = require('duoshuo');

var duoshuo = new Duoshuo({
  short_name: 'abc', // 站点申请的多说二级域名。
  secret: 'xxx' // 站点密钥
});

// fetch token
duoshuo.auth(code, function(err,token){
  console.log(token)
  // to sth with token    
});

var access_token = 'xxxxxxxxxxxxxxxxxx';	// 通过duoshuo.auth获得的access_token
var duoshuoClient = duoshuo.getClient(access_token);

// join local user to duoshuo.com
duoshuoClient.join({
  user: {},
}, function(err,user){
  console.log(err,user)
});

// fetch top articles
duoshuoClient.tops({
  range: 'daily' // 获取本日,详见:http://dev.duoshuo.com/docs/50398b4b8551ece011000023
  num_items: 10 // 获取10篇
}, function(err, threads){
  console.log(threads)
});

// push comments to duoshuo.com
duoshuoClient.comment({
  message: '我的一条新匿名评论'   
}, function(err,comment){
  console.log(comment)
});

Run Unit-test (Mocha)

$ git clone https://github.com/turingou/duoshuo.git
$ cd duoshuo
$ npm install
$ npm test

Current Tags

  • 0.3.0                                ...           latest (5 years ago)

20 Versions

  • 0.3.0                                ...           5 years ago
  • 0.2.7                                ...           5 years ago
  • 0.2.6                                ...           5 years ago
  • 0.2.5                                ...           5 years ago
  • 0.2.4                                ...           5 years ago
  • 0.2.3                                ...           5 years ago
  • 0.2.2                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.9                                ...           6 years ago
  • 0.0.8                                ...           6 years ago
  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 29
Dependencies (1)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |