2017 © Pedro Peláez
 

library koko-ai

A PHP client for the Koko API

image

koko/koko-ai

A PHP client for the Koko API

  • Tuesday, November 21, 2017
  • by rohankshir
  • Repository
  • 4 Watchers
  • 0 Stars
  • 10,170 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 67 % Grown

The README.md

koko-ai-php

koko-ai-php is a PHP client for https://docs.koko.ai, (*1)

Install

composer require koko/koko-ai

Usage

Create an instance of the client:, (*2)

include 'vendor/autoload.php';

use Koko\Tracker;

$koko = new Tracker(['auth' => 'YOUR_AUTH_KEY']);

Track content, see more here. These methods also take Guzzle request options as an optional second argument, so that you may override proxy and other settings., (*3)

$classification = $koko->trackContent([
  'id' => '123',
  'user_id' => '123',
  'type' => 'post',
  'content_type' => 'text',
  'content' => ['text' => 'Some content']
]);

$koko->trackFlag([
  'id' => '123',
  'flagger_id' => '123',
  'reasons' => ['crisis'],
  'targets' => [['content_id' => '123']]
]);

$koko->trackModeration([
  'id' => '123',
  'moderator_id' => '123',
  'action' => 'user_warned',
  'target' => ['content_id' => '123']
]);

Testing

Run the following command:, (*4)

php test.php

License

WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|

(The MIT License), (*5)

Copyright (c) 2017 Koko Inc. us@itskoko.com, (*6)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*7)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*8)

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*9)

The Versions

21/11 2017

dev-master

9999999-dev

A PHP client for the Koko API

  Sources   Download

MIT

The Requires

 

The Development Requires

21/11 2017

1.0.3

1.0.3.0

A PHP client for the Koko API

  Sources   Download

MIT

The Requires

 

The Development Requires

17/10 2017

1.0.2

1.0.2.0

A PHP client for the Koko API

  Sources   Download

MIT

The Requires

 

The Development Requires

28/09 2017

1.0.1

1.0.1.0

A PHP client for the Koko API

  Sources   Download

MIT

The Requires

 

The Development Requires

18/07 2017

0.0.1

0.0.1.0

A PHP client for the Koko API

  Sources   Download

MIT

The Requires

 

The Development Requires

18/07 2017

0.0.2

0.0.2.0

A PHP client for the Koko API

  Sources   Download

MIT

The Requires

 

The Development Requires

18/07 2017

0.0.3

0.0.3.0

A PHP client for the Koko API

  Sources   Download

MIT

The Requires

 

The Development Requires

18/07 2017

1.0.0

1.0.0.0

A PHP client for the Koko API

  Sources   Download

MIT

The Requires

 

The Development Requires