https://github.com/dfischer/akismet
Meteor wrapper for NPM akismet-api
https://github.com/dfischer/akismet
Last synced: about 1 year ago
JSON representation
Meteor wrapper for NPM akismet-api
- Host: GitHub
- URL: https://github.com/dfischer/akismet
- Owner: dfischer
- Created: 2014-09-17T12:44:59.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-17T12:54:06.000Z (almost 12 years ago)
- Last Synced: 2024-04-14T21:51:05.779Z (about 2 years ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
akismet
=======
Meteor wrapper for NPM akismet-api
define a settings.yml file for you to run with Meteor to set settings.
```
{
"Akismet": {
"key": "required",
"blog": "required"
}
}
```
`meteor --settings settings.json`
Then hook into the api as you see fit.
Exposed `verifyKey`, `checkSpam`, `submitSpam`, `submitHam` as the following wrapped methods:
`akismetVerifyKey`, `akismetCheckSpam`, `akismetSubmitSpam`, `akismetSubmitHam`
Just hook into those as you would in your comments code, e.g:
```
// use comment object values somewhere
var checkSpam = {
user_ip : comment.user_ip,
user_agent : comment.user_agent,
referrer : comment.referrer,
comment_type : 'comment',
comment_author : comment.author,
comment_content : comment.body
};
var isSpam = Meteor.call('akismetCheckSpam', checkSpam); // true for spam
if(isSpam) {
comment.isSpam = true;
return Comments.insert(comment);
} else {
Posts.update(comment.postId, {
$inc: { commentsCount: 1 }
});
return Comments.insert(comment);
}
```