Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Commit

Permalink
Closes #8.
Browse files Browse the repository at this point in the history
Implemented Posts.

Stable Version 0.12.0.
  • Loading branch information
jmdobry committed Jun 17, 2014
1 parent bad980a commit 827033d
Show file tree
Hide file tree
Showing 12 changed files with 1,449 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@
"sub": true,
"trailing": true,
"white": true,
"indent": 4
"indent": 2
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
##### 0.12.0 - 16 June 2014

###### Backwards compatible API changes
- #8 - Implemented Posts

##### 0.11.0 - 15 June 2014

###### Breaking API changes
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function (grunt) {

watch: {
dist: {
files: ['lib/**/*.js', 'test/**.*.js', 'README.md'],
files: ['lib/**/*.js', 'test/**.*.js', 'README.md', 'doc.md'],
tasks: ['build']
}
},
Expand Down
137 changes: 135 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,156 @@ Copyright © 2014 Jason Dobry
[![Dependency Status](https://gemnasium.com/jmdobry/disqus-node.svg)](https://gemnasium.com/jmdobry/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
- Applications
- Blacklists
- Categories
- Exports
- Forums
- Imports
- Posts
- Topics
- Trends
- Whitelists

<br/>
## Not Yet Implemented
- Posts
- Threads
- Users

<br/>
## License
[Apache License Version 2.0](https://github.com/jmdobry/disqus-node/blob/master/LICENSE)
137 changes: 135 additions & 2 deletions doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,156 @@ Copyright © 2014 Jason Dobry
[![Dependency Status](https://gemnasium.com/jmdobry/disqus-node.svg)](https://gemnasium.com/jmdobry/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
- Applications
- Blacklists
- Categories
- Exports
- Forums
- Imports
- Posts
- Topics
- Trends
- Whitelists

<br/>
## Not Yet Implemented
- Posts
- Threads
- Users

<br/>
## License
[Apache License Version 2.0](https://github.com/jmdobry/disqus-node/blob/master/LICENSE)

0 comments on commit 827033d

Please sign in to comment.