Namespace: sfs

sfs

StopForumSpam Module

Source:

Namespaces

User

Members


<static> config

Default Configuration settings for stopforumspam

Source:

Methods


<static> isSpammer(userObject)

Checks if a user is a spammer. Pass only the parameters you wish to search for

Parameters:
Name Type Description
userObject object

a hashlike object with each of the parameters to search for.
Search for as many or as few as you wish.

Source:
Throws:
  • throws an error if the email or IP is passed and invalid or the IP is not IPv4.
    Stopforumsspam.com does not support IPv6 addresses.

  • throws any error it recieves from the response, including status codes that are not 200

Returns:

Promise which returns true if the user is found on StopForumSpam.com

Example
stopforumspam.isSpammer({ ip: '123.456.789.100', email: 'test@test.com', username: 'Spammer!' })
  .then(function (result) {
  // result if false if not found
  // result = {
  //   success: 1,
  //   username: {
  //     lastseen: '2015-03-09 15:22:49',
  //     frequency: 3830,
  //     appears: 1,
  //     confidence: 90.2 } }
});

<static> isSpammerSync()

Synchronous version of isSpammer
Uses ES6 yield trick https://github.com/luciotato/waitfor-ES6#the-funny-thing-is

Source:

<static> Key(key) → {string}

Getter & Setter for the API Key

Parameters:
Name Type Description
key string

The API Key for StopForumSpam.com Necessary for
submitting users to the database. Unset it with an empty string or false.

Source:
Returns:

The current API Key as it is set

Type
string

<static> submit(userObject, evidence)

Submits the user to StopForumSpam.com under your API key
Requires config.apiKey is set

Parameters:
Name Type Description
userObject

must contain properties for each searchParameter
empty parameters will throw an error

evidence string

(optional) you can tell StopForumSpam.com your reasoning if you like

Source:
Throws:
  • throws an error if you have not set the API key

  • throws an error if you don't pass a user object with all of the parameters
    (ip, email, & username)

  • throws any error it recieves from the response, including status codes that are not 200

Returns:

Promise

Example
stopforumspam.Key('some-api-key');
// or stopforumspam.config.apiKey = 'some-api-key';
stopforumspam.submit({ ip: '123.456.789.100', email: 'test@test.com', username: 'Spammer!' }, 'Caught You!');

<static> submitSync()

Synchronous version of submit
Uses ES6 yield trick https://github.com/luciotato/waitfor-ES6#the-funny-thing-is

Source: