dayrev/smmry-sdk-php

PHP SDK for Smmry Text Summarization API.

v1.2.1 2017-03-10 08:13 UTC

This package is not auto-updated.

Last update: 2024-11-02 13:55:28 UTC


README

Build Status Coverage Status Latest Stable Version

Overview

A simple SDK interface for interacting with the Smmry text summarization API.

Installation

Run the following composer command to add the package to your project:

composer require dayrev/smmry-sdk-php

Alternatively, add "dayrev/smmry-sdk-php": "^1.0" to your composer.json file.

Usage

$sdk = new DayRev\Smmry\SDK(['api_key' => 'YOURKEYHERE', 'summary_length' => 5]);
$summary = $sdk->summarizeText($long_text_string_here);

OR

$sdk = new DayRev\Smmry\SDK(['api_key' => 'YOURKEYHERE', 'summary_length' => 5]);
$summary = $sdk->summarizeUrl('http://collegefootball.ap.org/article/mayfield-leads-oklahoma-35-19-sugar-bowl-win-over-auburn');

Tests

To run the test suite, run the following commands from the root directory:

composer install
vendor/bin/phpunit -d api_key=YOUR_SMMRY_API_KEY

Note: A valid Smmry API key is required when running the integration tests.