disqus-node
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -0,1 +1,6 @@ | ||
##### 0.12.0 - 16 June 2014 | ||
###### Backwards compatible API changes | ||
- #8 - Implemented Posts | ||
##### 0.11.0 - 15 June 2014 | ||
@@ -2,0 +7,0 @@ |
137
doc.md
@@ -20,4 +20,135 @@ disqus-node | ||
## Documentation | ||
[API](/lib/index.html) | [CLI](/lib/cli/index.html) | ||
__[Disqus v3.0 API Documentation](https://disqus.com/api/docs/)__ | ||
<br/> | ||
#### API Client Library | ||
__[API Client Library Documentation](/lib/index.html)__ | ||
```js | ||
var Disqus = require('disqus-node'); | ||
var disqus = new Disqus({ | ||
// required | ||
api_secret: 'abcdefgh', | ||
// required when authentication is required | ||
access_token: '12345678', | ||
// defaults shown | ||
logLevel: 'info', | ||
https: true | ||
}); | ||
// promise-style | ||
disqus.forums.listPosts({ | ||
forum: 'pseudobry', | ||
limit: 3 | ||
}).then(function (response) { | ||
response; // { | ||
"cursor": {...}, | ||
"code": 0, | ||
"response": [ | ||
{...}, | ||
{...}, | ||
{...} | ||
] | ||
} | ||
}); | ||
// node-style | ||
disqus.forums.listPosts({ | ||
forum: 'pseudobry', | ||
limit: 3 | ||
}, function (err, response) { | ||
response; // { | ||
"cursor": {...}, | ||
"code": 0, | ||
"response": [ | ||
{...}, | ||
{...}, | ||
{...} | ||
] | ||
} | ||
}); | ||
``` | ||
<br/> | ||
#### Command-line Interface | ||
__[CLI Documentation](/lib/cli/index.html)__ | ||
``` | ||
$ npm install -g disqus-node | ||
``` | ||
CLI available as `disqus`. `disqus` has a number of available resources: | ||
``` | ||
$ disqus -h | ||
Usage: disqus <cmd> <subCmd> [options] | ||
Commands: | ||
applications <cmd> [options] Execute command for the Applications resource. | ||
blacklists <cmd> [options] Execute command for the Blacklists resource. | ||
categories <cmd> [options] Execute command for the Categories resource. | ||
exports <cmd> [options] Execute command for the Exports resource. | ||
forums <cmd> [options] Execute command for the Forums resource. | ||
imports <cmd> [options] Execute command for the Imports resource. | ||
posts <cmd> [options] Execute command for the Posts resource. | ||
topics <cmd> [options] Execute command for the Topics resource. | ||
trends <cmd> [options] Execute command for the Trends resource. | ||
whitelists <cmd> [options] Execute command for the Whitelists resource. | ||
Options: | ||
-h, --help output usage information | ||
-V, --version output the version number | ||
``` | ||
Each resource has available commands: | ||
``` | ||
$ disqus forums -h | ||
Usage: disqus forums <cmd> [options] | ||
Commands: | ||
addModerator [options] Adds a moderator to a forum. | ||
create [options] Creates a new forum. | ||
details [options] Returns forum details. | ||
follow [options] Follow a forum. | ||
installed [options] Returns true if forum has one or more views. | ||
listCategories [options] Returns a list of categories within a forum. | ||
listFollowers [options] Returns a list of users following a forum. | ||
listModerators [options] Returns a list of all moderators on a forum. | ||
listMostActiveUsers [options] Returns a list of users active within a forum ordered by most comments made. | ||
listMostLikedUsers [options] Returns a list of users active within a forum ordered by most likes received. | ||
listPosts [options] Returns a list of posts within a forum. | ||
listThreads [options] Returns a list of threads within a forum sorted by the date created. | ||
listUsers [options] Returns a list of users active within a forum. | ||
removeModerator [options] Removes a moderator from a forum. | ||
unfollow [options] Unfollow a forum. | ||
Options: | ||
-h, --help output usage information | ||
``` | ||
<br/> | ||
``` | ||
$ disqus forums listPosts -f pseudobry -S '1234abcd' -l 3 | ||
{ | ||
"cursor": {...}, | ||
"code": 0, | ||
"response": [ | ||
{...}, | ||
{...}, | ||
{...} | ||
] | ||
} | ||
``` | ||
<br/> | ||
## Functional | ||
@@ -30,2 +161,3 @@ - Applications | ||
- Imports | ||
- Posts | ||
- Topics | ||
@@ -35,8 +167,9 @@ - Trends | ||
<br/> | ||
## Not Yet Implemented | ||
- Posts | ||
- Threads | ||
- Users | ||
<br/> | ||
## License | ||
[Apache License Version 2.0](https://github.com/jmdobry/disqus-node/blob/master/LICENSE) |
@@ -14,3 +14,3 @@ module.exports = function (grunt) { | ||
dist: { | ||
files: ['lib/**/*.js', 'test/**.*.js', 'README.md'], | ||
files: ['lib/**/*.js', 'test/**.*.js', 'README.md', 'doc.md'], | ||
tasks: ['build'] | ||
@@ -17,0 +17,0 @@ } |
@@ -6,3 +6,3 @@ var commander = require('commander'); | ||
/** | ||
``` | ||
* ``` | ||
MBP:~ jason$ npm install -g disqus-node | ||
@@ -12,3 +12,3 @@ | ||
... | ||
disqus-node@0.11.0 usr/local/lib/node_modules/disqus-node | ||
disqus-node@0.12.0 usr/local/lib/node_modules/disqus-node | ||
@@ -27,2 +27,3 @@ MBP:~ jason$ disqus -h | ||
imports <cmd> [options] Execute command for the Imports resource. | ||
posts <cmd> [options] Execute command for the Posts resource. | ||
topics <cmd> [options] Execute command for the Topics resource. | ||
@@ -125,2 +126,9 @@ trends <cmd> [options] Execute command for the Trends resource. | ||
/** | ||
* ###### Posts | ||
* [API](/lib/api/imports.html) | [CLI](/lib/cli/imports.html) | [Disqus](https://disqus.com/api/docs/imports/) | ||
*/ | ||
disqus | ||
.command('posts <cmd> [options]') | ||
.description('Execute command for the Posts resource.'); | ||
/** | ||
* ###### Topics | ||
@@ -157,2 +165,3 @@ * [API](/lib/api/topics.html) | [CLI](/lib/cli/topics.html) | [Disqus](https://disqus.com/api/docs/topics/) | ||
case 'imports': | ||
case 'posts': | ||
case 'topics': | ||
@@ -159,0 +168,0 @@ case 'trends': |
@@ -38,2 +38,3 @@ /** | ||
var Imports = container.get('Imports'); | ||
var Posts = container.get('Posts'); | ||
var Topics = container.get('Topics'); | ||
@@ -134,2 +135,7 @@ var Trends = container.get('Trends'); | ||
/** | ||
* ###### Posts | ||
* [API](/lib/api/posts.html) | [CLI](/lib/cli/posts.html) | [Disqus](https://disqus.com/api/docs/posts/) | ||
*/ | ||
this.posts = new Posts(this.config); | ||
/** | ||
* ###### Topics | ||
@@ -136,0 +142,0 @@ * [API](/lib/api/topics.html) | [CLI](/lib/cli/topics.html) | [Disqus](https://disqus.com/api/docs/topics/) |
{ | ||
"name": "disqus-node", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "Disqus API bindings and CLI for NodeJS http://disqus.com/api/", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
137
README.md
@@ -20,4 +20,135 @@ disqus-node | ||
## Documentation | ||
[API](http://disqus-node.pseudobry.com/lib/index.html) | [CLI](http://disqus-node.pseudobry.com/lib/cli/index.html) | ||
__[Disqus v3.0 API Documentation](https://disqus.com/api/docs/)__ | ||
<br/> | ||
#### API Client Library | ||
__[API Client Library Documentation](http://disqus-node.pseudobry.com/lib/index.html)__ | ||
```js | ||
var Disqus = require('disqus-node'); | ||
var disqus = new Disqus({ | ||
// required | ||
api_secret: 'abcdefgh', | ||
// required when authentication is required | ||
access_token: '12345678', | ||
// defaults shown | ||
logLevel: 'info', | ||
https: true | ||
}); | ||
// promise-style | ||
disqus.forums.listPosts({ | ||
forum: 'pseudobry', | ||
limit: 3 | ||
}).then(function (response) { | ||
response; // { | ||
"cursor": {...}, | ||
"code": 0, | ||
"response": [ | ||
{...}, | ||
{...}, | ||
{...} | ||
] | ||
} | ||
}); | ||
// node-style | ||
disqus.forums.listPosts({ | ||
forum: 'pseudobry', | ||
limit: 3 | ||
}, function (err, response) { | ||
response; // { | ||
"cursor": {...}, | ||
"code": 0, | ||
"response": [ | ||
{...}, | ||
{...}, | ||
{...} | ||
] | ||
} | ||
}); | ||
``` | ||
<br/> | ||
#### Command-line Interface | ||
__[CLI Documentation](http://disqus-node.pseudobry.com/lib/cli/index.html)__ | ||
``` | ||
$ npm install -g disqus-node | ||
``` | ||
CLI available as `disqus`. `disqus` has a number of available resources: | ||
``` | ||
$ disqus -h | ||
Usage: disqus <cmd> <subCmd> [options] | ||
Commands: | ||
applications <cmd> [options] Execute command for the Applications resource. | ||
blacklists <cmd> [options] Execute command for the Blacklists resource. | ||
categories <cmd> [options] Execute command for the Categories resource. | ||
exports <cmd> [options] Execute command for the Exports resource. | ||
forums <cmd> [options] Execute command for the Forums resource. | ||
imports <cmd> [options] Execute command for the Imports resource. | ||
posts <cmd> [options] Execute command for the Posts resource. | ||
topics <cmd> [options] Execute command for the Topics resource. | ||
trends <cmd> [options] Execute command for the Trends resource. | ||
whitelists <cmd> [options] Execute command for the Whitelists resource. | ||
Options: | ||
-h, --help output usage information | ||
-V, --version output the version number | ||
``` | ||
Each resource has available commands: | ||
``` | ||
$ disqus forums -h | ||
Usage: disqus forums <cmd> [options] | ||
Commands: | ||
addModerator [options] Adds a moderator to a forum. | ||
create [options] Creates a new forum. | ||
details [options] Returns forum details. | ||
follow [options] Follow a forum. | ||
installed [options] Returns true if forum has one or more views. | ||
listCategories [options] Returns a list of categories within a forum. | ||
listFollowers [options] Returns a list of users following a forum. | ||
listModerators [options] Returns a list of all moderators on a forum. | ||
listMostActiveUsers [options] Returns a list of users active within a forum ordered by most comments made. | ||
listMostLikedUsers [options] Returns a list of users active within a forum ordered by most likes received. | ||
listPosts [options] Returns a list of posts within a forum. | ||
listThreads [options] Returns a list of threads within a forum sorted by the date created. | ||
listUsers [options] Returns a list of users active within a forum. | ||
removeModerator [options] Removes a moderator from a forum. | ||
unfollow [options] Unfollow a forum. | ||
Options: | ||
-h, --help output usage information | ||
``` | ||
<br/> | ||
``` | ||
$ disqus forums listPosts -f pseudobry -S '1234abcd' -l 3 | ||
{ | ||
"cursor": {...}, | ||
"code": 0, | ||
"response": [ | ||
{...}, | ||
{...}, | ||
{...} | ||
] | ||
} | ||
``` | ||
<br/> | ||
## Functional | ||
@@ -30,2 +161,3 @@ - Applications | ||
- Imports | ||
- Posts | ||
- Topics | ||
@@ -35,8 +167,9 @@ - Trends | ||
<br/> | ||
## Not Yet Implemented | ||
- Posts | ||
- Threads | ||
- Users | ||
<br/> | ||
## License | ||
[Apache License Version 2.0](https://github.com/jmdobry/disqus-node/blob/master/LICENSE) |
@@ -9,2 +9,3 @@ module.exports = function (container) { | ||
container.register('API.Imports.test', require('./Imports.test')); | ||
container.register('API.Posts.test', require('./Posts.test')); | ||
container.register('API.Topics.test', require('./Topics.test')); | ||
@@ -20,2 +21,3 @@ container.register('API.Trends.test', require('./Trends.test')); | ||
describe('Imports', container.get('API.Imports.test')); | ||
describe('Posts', container.get('API.Posts.test')); | ||
describe('Topics', container.get('API.Topics.test')); | ||
@@ -22,0 +24,0 @@ describe('Trends', container.get('API.Trends.test')); |
Sorry, the diff of this file is not supported yet
219448
49
5256
173