npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pottymouth

v0.0.8

Published

PottyMouth SDK

Downloads

2

Readme

PottyMouth SDK for Node

What is PottyMouth?

PottyMouth is an advanced chat, username and content filtering service offering automated risk factors based on user behavior. The service also offers moderation tools and tight-knit integration into web platforms of many shapes and sizes.

More information on the service can be found at: http://pottymouthfilter.com/

What is this SDK?

This SDK is a lightweight wrapper library that takes care of all of the RESTful communications to the PottyMouth service. The goal is to cover all of PottyMouth's features via easy to use function calls using Node's standard callback structure.

What has been implemented so far?

  • HTTPS RESTful communication with PottyMouth service.
  • Basic username risk factor checking and adding to moderation queue.

Installation

Simply run npm install pottymouth in the root of your project.

Usage:

###Setup:

var pmSettings = {
  host: 'yourhost.pottymouthfilter.com',
  apiToken: 'yourAPItoken'
};
var PottyMouth = require('pottymouth')(pmSettings);

###Setup for Staging/Insecure Mode

In the event that you need to run on HTTP instead of HTTPS you can pass an alternate port number and secure property:

var pmSettings = {
  host: 'staging.yourhost.pottymouthfilter.com',
  apiToken: 'yourAPItoken',
  port: 8080,
  secure: false
};
var PottyMouth = require('pottymouth')(pmSettings);

###Username moderation:

Checking the Risk Factor of a Username:

/*
  Parameters:
    nickname,
    unique player ID,
    (optional) 2 digit language code,
    (optional) rule set to use,
    callback function
*/
PottyMouth.checkUsername('brent1167', '12345', 'en', 1, function(err, result) {
  if (err) return console.error(err.message);
  var response = result.response;
  var risk = result.risk;

  // Do something with the response/risk information

});

Adding a username to a moderation queue:

/*
  Parameters:
    nickname,
    unique player ID,
    bucket id,
    callback function
*/
PottyMouth.moderateUsername('brent1167', '12345', 1, function(err, result) {
  console.log(err, result);
});

###Content moderation:

Some of these features aren't available to all PottyMouth users, as they're custom implementations. Please ask them if your account supports these features if you are unsure.

Adding custom content to a moderation queue:

// Custom object to be passed into the moderation queue (sample only)
var contentObject = {
  hash: 'sample',
  url: 'http://...',
  example: true
};

PottyMouth.moderateContent('queue_name', contentObject, function(err, result) {
  console.log(err, result);
});

Contributing:

This software is offered into the open source world by Just Be Friends (www.justbefriends.net) in hopes that others will find it useful.

Any contributions would be appreciated in the form of pull requests. It should be noted that we will be adding features to this library when time permits - so feel to reach out and ask to be put in touch with our dev team if you are wanting to make significant changes: [email protected]