akismet 0.2.1

Akismet.dart

Prevent comment spam using Akismet service, in Dart.

Features

  • Key verification: checks an Akismet API key and gets a value indicating whether it is valid.
  • Comment check: checks a comment and gets a value indicating whether it is spam.
  • Submit spam: submits a comment that was not marked as spam but should have been.
  • Submit ham: submits a comment that was incorrectly marked as spam but should not 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:

import 'package:akismet/html.dart'; // In browser applications.
import 'package:akismet/io.dart'; // In console applications.

Usage

Key Verification

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

Comment Check

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

client.submitSpam(comment).then((_) => print('Spam submitted.'));
client.submitHam(comment).then((_) => print('Ham submitted.'));

License

Akismet.dart is distributed under the MIT License.

Changelog

This file contains highlights of what changes on each version of the Akismet.dart package.

Version 0.2.1

  • Added new properties and methods to Server class.
  • Added utility scripts in tool folder.
  • Changed the package layout.
  • Breaking change: renamed Server.secureRequests property to useSecureRequests.

Version 0.2.0

  • Added client implementation based on dart:html.
  • Added server implementation used to proxy requests from HTML clients to Akismet service.
  • Breaking change: Uri in constructors can no longer be specified as String.
  • Breaking change: removed Client.encoding property.

Version 0.1.1

  • Added EndPoints class providing the URLs of the Akismet service end points.
  • Fixed issue #1.

Version 0.1.0

  • Initial release: client implementation based on dart:io.

1. Depend on it

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

dependencies:
  akismet: ">=0.2.1 <0.3.0"

If your package is an application package you should use any as the version constraint.

2. Install it

If you're using the Dart Editor, choose:

Menu > Tools > Pub Install

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

$ pub install

3. Import it

Now in your Dart code, you can use:

import 'package:akismet/core.dart';
import 'package:akismet/html.dart';
import 'package:akismet/io.dart';
Version Uploaded Archive
0.2.1 Dec 20, 2013 Download akismet 0.2.1 archive
0.2.0 Nov 24, 2013 Download akismet 0.2.0 archive
0.1.1 Nov 18, 2013 Download akismet 0.1.1 archive
0.1.0 Nov 15, 2013 Download akismet 0.1.0 archive

About

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

Author

Email cedric@belin.io C├ędric Belin

Homepage

https://github.com/cedx/akismet.dart

Uploader

cedxbelin

Share