New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

disqus-server-client

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

disqus-server-client

Strongly typed client that helps your server to connect to the Disqus API.

unpublished
latest
Source
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

Disqus Server Client - Strongly Typed

Strongly typed client that helps your server to connect to the Disqus API.

Features

The Disqus API - although not very documented - is very easy to implement. This implementation has a view advantages:

  • Implemented using TypeScript, so we have types and you have auto-complete
  • Uses Axios which gives use Promises, so you can use async and await
  • Uses Node Cache to cache some endpoints, so your performance is better.
  • All end points were generated from the Disqus API docs, so you don't have to look them up.
  • Forward compatible. If Disqus creates new end points, you can still use them by calling the post, get or the request method.

Drawbacks from this method:

  • Not all end points are documented.
  • Not all end points have examples, so we could not generate all return typed.

API

Let's show some code.

New up a client:

// Node.js
const { Disqus } = require("disqus-server-client")

// Or TypeScript:
import { Disqus } from 'disqus-server-client'

const config = {
    accessToken: "...",
    apiKey:      "...",
    apiSecret:   "..."
}

const disqus = new Disqus(config)

Getting the posts:

const r = await disqus.post.list({ forum: "keestalkstech" })
const posts = r.response.map(post => ({
    msg: post.msg,
    by: post.author.name || post.author.username,
    thread: post.thread
}))

console.log(posts);

Getting the details of a thread:

const id = "...";
const r = await disqus.threads.details({ thread: id })
const thread = {
    title: r.response.title,
    url: r.response.link,
};

console.log(title);

Maintenance

This project is maintained by Kees C. Bakker.

Keywords

Disqus

FAQs

Package last updated on 22 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts