GithubHelp home page GithubHelp logo

dglinyanov / akismet.dart Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 338 KB

Prevent comment spam using Akismet service, in Dart.

Home Page: https://pub.dartlang.org/packages/akismet

License: MIT License

Shell 0.25% Dart 79.52% CSS 20.24%

akismet.dart's Introduction

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.

Documentation

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.

akismet.dart's People

Contributors

cedx avatar dglinyanov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.