cleverbot 0.2.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 37

cleverbot Pub #

A wrapper for interacting with the Cleverbot API.

Usage #

Get your API key at The official Cleverbot API site.

A simple usage example:

import 'package:cleverbot/cleverbot.dart';

main() async {
  var cleverbot = new Cleverbot("<YOUR APIKEY HERE>");
  var result = await cleverbot.think('Hello Cleverbot!');
  print(result);
}

For usage in the browser just import cleverbot_browser.dart:

import 'package:cleverbot/cleverbot_browser.dart';

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Changelog #

0.2.0 #

  • upgraded to Dart SDK 2.0

0.1.0 #

  • fixed exceptions on wrongly encoded interaction history

0.0.8 - 0.0.9 #

  • added a few hints for cleverbot.com
  • added wrapper parameter

0.0.4 - 0.0.7 #

  • fixed UTF8 errors
  • refactored code

0.0.3 #

  • fixed example in readme :)

0.0.2 #

  • added support for usage from browser AND console

0.0.1 #

  • implemented basic functionality

example/cleverbot_example.dart

// Copyright (c) 2017, 'rinukkusu'. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:cleverbot/cleverbot.dart';

main() async {
  var cleverbot = new Cleverbot("<YOUR APIKEY HERE>");
  var result = await cleverbot.think('Hello Cleverbot!');
  print(result);
}

Use this package as a library

1. Depend on it

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


dependencies:
  cleverbot: ^0.2.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:cleverbot/cleverbot.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
40
Overall:
Weighted score of the above. [more]
37
Learn more about scoring.

We analyzed this package on May 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.1
  • pana: 0.13.8-dev

Health suggestions

Fix lib/src/cleverbot_base.dart. (-1.49 points)

Analysis of lib/src/cleverbot_base.dart reported 3 hints:

line 6 col 14: The value of the field '_debug' isn't used.

line 9 col 32: Unnecessary new keyword.

line 10 col 28: Unnecessary new keyword.

Fix lib/src/cleverbot_browser.dart. (-0.50 points)

Analysis of lib/src/cleverbot_browser.dart reported 1 hint:

line 9 col 18: Unnecessary new keyword.

Fix lib/src/cleverbot_io.dart. (-0.50 points)

Analysis of lib/src/cleverbot_io.dart reported 1 hint:

line 9 col 18: Unnecessary new keyword.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: Documenting cleverbot... Initialized dartdoc with 140 libraries in 35.0 seconds Generating docs for library cleverbot from package:cleverbot/cleverbot_browser.dart... Generating docs for library cleverbot from package:cleverbot/cleverbot.dart... Validating docs... Documented 2 public libraries in 6.3 seconds stderr: error: failed to write file at: cleverbot/cleverbot-library.html for symbol cleverbot: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/cleverbot.dart:7:9) conflicting with file already generated by cleverbot: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/cleverbot_browser.dart:7:9) Dartdoc generates a path and filename to write to for each symbol. cleverbot conflicts with another symbol in the generated path, and therefore can not be written out. Changing the name, library name, or class name (if appropriate) of one of the conflicting items can resolve the conflict. Alternatively, use the @nodoc tag in one symbol's documentation comments to hide it. error: failed to write file at: cleverbot/Cleverbot-class.html, for symbol cleverbot.Cleverbot: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/src/cleverbot_io.dart:5:7) error: failed to write file at: cleverbot/Cleverbot/Cleverbot.html for symbol cleverbot.Cleverbot.Cleverbot: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/src/cleverbot_io.dart:6:3) conflicting with file already generated by cleverbot.Cleverbot.Cleverbot: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/src/cleverbot_browser.dart:6:3) error: failed to write file at: cleverbot/CleverbotBase-class.html, for symbol cleverbot.CleverbotBase: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/src/cleverbot_base.dart:5:16) error: failed to write file at: cleverbot/CleverbotBase/CleverbotBase.html for symbol cleverbot.CleverbotBase.CleverbotBase: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/src/cleverbot_base.dart:17:3) conflicting with file already generated by cleverbot.CleverbotBase.CleverbotBase: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/src/cleverbot_base.dart:17:3) error: failed to write file at: cleverbot/CleverbotBase/think.html for symbol cleverbot.CleverbotBase.think: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/src/cleverbot_base.dart:19:18) conflicting with file already generated by cleverbot.CleverbotBase.think: (file:///tmp/pub-dartlang-dartdocRHTSEF/pkg/lib/src/cleverbot_base.dart:19:18) found 0 warnings and 6 errors Unhandled exception: dartdoc encountered 6 errors while processing. #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:202:7)

Package is getting outdated. (-50.41 points)

The package was last published 78 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
http ^0.12.0 0.12.1
Transitive dependencies
charcode 1.1.3
collection 1.14.12
http_parser 3.1.4
meta 1.1.8
path 1.7.0
pedantic 1.9.0
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6