https://github.com/planeshifter/node-spam-detector
small utility app to detect spam URLs
https://github.com/planeshifter/node-spam-detector
Last synced: about 1 year ago
JSON representation
small utility app to detect spam URLs
- Host: GitHub
- URL: https://github.com/planeshifter/node-spam-detector
- Owner: Planeshifter
- License: mit
- Created: 2014-08-13T22:35:01.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-20T21:21:14.000Z (almost 12 years ago)
- Last Synced: 2025-04-08T18:57:24.138Z (about 1 year ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://badge.fury.io/js/spam-detector)
[](http://travis-ci.org/Planeshifter/node-spam-detector)
node-spam-detector
======================
This little module exposes a single function which can be used to check whether a given URL is considered spam after consulting several major domain blacklists. Under the hood, the function first uses the `unshortener` package to
reduce the URL to its original form in case that it was shortened. It then makes DNS calls to blacklists provided by URIBL, Spamhaus and SURBL.
## Installation & Loading
The module can be easily installed via npm:
```
npm install spam-detector
```
To use it in a project, require the package with the command
```
isSpam = require("spam-detector");
```
## Syntax
### isSpam(url, callback)
The function has two parameters: The first is the URL which has to be checked, and the second is a callback function of the form `function(err, data)`. The first argument `err` is equal to `null` if no error has occured during checking and an Error object otherwise. The second argument is a Boolean value which evaluates to `true` in case that the supplied URL is considered to be spam and `false` otherwise.
Example:
```
var isSpam = require("spam-detector");
isSpam("http://www.github.com", function(err, data){
console.log(data);
});
```
Output:
```
false
```