pottymouth
v0.0.8
Published
PottyMouth SDK
Downloads
2
Maintainers
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]