PHP code example of the-3labs-team / laravel-readability

1. Go to this page and download the library: Download the-3labs-team/laravel-readability library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

the-3labs-team / laravel-readability example snippets


$html = '<html>...</html>';
$parsed = Readability::parse($html);
$title = $parsed->getTitle();

$html = '<html>...</html>';
$parsed = Readability::parse($html);

$title = $parsed->getTitle();
$content = $parsed->getContent();
$excerpt = $parsed->getExcerpt();
$author = $parsed->getAuthor();
$direction = $parsed->getDirection();
$image = $parsed->getImage();
$images = $parsed->getImages();