akismet 0.1.0 copy "akismet: ^0.1.0" to clipboard
akismet: ^0.1.0 copied to clipboard

discontinued
outdatedDart 1 only

Prevent comment spam using Akismet service (https://akismet.com).

Akismet.dart #

Prevent comment spam using Akismet service, in Dart.

Features #

  • Key verification: checks an API key against the service database, and gets a value indicating whether it is valid.
  • Comment check: checks a comment against the service database, and gets a value indicating whether it is spam.
  • Submit spam: submits a comment that was incorrectly marked as spam but should not have been.
  • Submit ham: submits a comment that was not marked as spam but should have been.

Installing via Pub #

1. Depend on it #

Add this to your package's pubspec.yaml file:

dependencies:
	akismet: any

2. Install it #

If you're using the Dart Editor, choose:

Menu > Tools > Pub Get

Or if you want to install from the command line, run:

$ pub get

3. Import it #

Now in your Dart code, you can use one of the three following statements:

import 'package:akismet/io.dart';

Usage #

Key Verification #

var client=new Client('123YourAPIKey', 'http://your.blog.url');    
client.verifyKey().then((isValid) {
  print(isValid ? 'Your API key is valid.' : 'Your API key is invalid.');
});

Comment Check #

var client=new Client('123YourAPIKey', 'http://your.blog.url');
var comment=new Comment('A comment.', new Author('An author.'));
 
client.checkComment(comment).then((isSpam) {
  print(isSpam ? 'The comment is marked as spam.' : 'The comment is marked as ham.');
});

Submit Spam/Ham #

var client=new Client('123YourAPIKey', 'http://your.blog.url');
var comment=new Comment('A comment.', new Author('An author.'));

client.submitSpam(comment).then((_) {
  print('Spam submitted.');
});

client.submitHam(comment).then((_) {
  print('Ham submitted.');
});

License #

Akismet.dart is distributed under the MIT License.

1
likes
0
points
85
downloads

Publisher

verified publisherbelin.io

Weekly Downloads

Prevent comment spam using Akismet service (https://akismet.com).

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

http

More

Packages that depend on akismet