sukohi/laravel-readability
LaravelReadability
A Laravel package to extract readable text from HTML.
This package is actually a wrapper class of feelinglucky/php-readability.
Installation
Execute composer command.
composer require sukohi/laravel-readability:2.*
Set the service provider in app.php
'providers' => [
Sukohi\LaravelReadability\LaravelReadabilityServiceProvider::class
]
and alias.
'aliases' => [
'LaravelReadability' => Sukohi\LaravelReadability\Facades\LaravelReadability::class
]
Basic Usage
$readability = \LaravelReadability::make($html);
try {
$data = $readability->getContent();
dd($data)
} catch (\Exception $e) {
// Content not found
}
with Encoding
$readability = \LaravelReadability::make($html, 'Shift_JIS');
License
This package is licensed under the MIT License.
Copyright 2016 Sukohi Kuhoh
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
637,827,751
9,703
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
413,412,504
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
391,429,217
4,660