Giter Site home page Giter Site logo

disqus-node's Introduction

disqus-node

Disqus API bindings and CLI for NodeJS. disqus-node documentation.

Copyright © 2014 Jason Dobry

Status

NPM

Build Status

Coverage Status

Code Climate

Dependency Status

Documentation

Disqus v3.0 API Documentation


#### API Client Library __[API Client Library Documentation](http://disqus-node.pseudobry.com/lib/index.html)__
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": [
                   {...},
                   {...},
                   {...}
                 ]
               }
});

#### 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

$ disqus forums listPosts -h
  
Usage: listPosts [options]
  
Options:
  
-h, --help                 output usage information
-c, --cursor [cursor]      Defaults to null,
-f, --forum <string>       Looks up a forum by ID (aka short name).
-H, --https [boolean]      Whether to use https. Defaults to true.
-i, --include [array]      Defaults to ["approved"]. Choices: unapproved, approved, spam, deleted, flagged, highlighted.
-l, --limit [number]       Maximum number of posts to return. Maximum value of 100. Defaults to 25.
-L, --logLevel [string]    Output log level. Choices: debug, info, notice, warning, error, critical, alert, emergency.
-o, --order [string]       Choices: asc, desc. Defaults to "desc".
-q, --query [string]       Defaults to null.
-r, --related [array]      You may specify relations to include with your response. Choices: thread.
-s, --since [string]       Unix timestamp (or ISO datetime standard).
-S, --api_secret <string>  Your application's api_secret.

$ disqus forums listPosts -f pseudobry -S '1234abcd' -l 3

{
  "cursor": {...},
  "code": 0,
  "response": [
    {...},
    {...},
    {...}
  ]
}

## Functional - Applications - Blacklists - Categories - Exports - Forums - Imports - Posts - Topics - Trends - Whitelists
## Not Yet Implemented - Threads - Users
## License [Apache License Version 2.0](https://github.com/jmdobry/disqus-node/blob/master/LICENSE)

disqus-node's People

Contributors

jarib avatar jmdobry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

disqus-node's Issues

Client-side support?

I'd like to use your package for a client-side web app using Browserify. The problem is that you currently require the api_secret for all APIs, which precludes use on the client side unless you want to expose your key to the world. Some APIs (e.g. details) will work with the public key, and I guess that client-side OAuth can be performed without the secret key, right? Would it make sense to add support for this to your package?

create Forum is giving error

Hi.. I'm trying to add forum in disqus. but I'm not able to do it yet

Here is my code:

disqus.forums.create({
    website: 'https://disqus.com/api/3.0/forums/create.json',
    name: 'Test Name',
    short_name: 'test'
  },function (err, data) {
 console.log(data);
});

can somebody help me here?

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.