22 lines
365 B
PHP
22 lines
365 B
PHP
<?php
|
|
|
|
include_once 'vendor/autoload.php';
|
|
|
|
use Readability\Readability;
|
|
|
|
$url = urldecode($_GET["url"]);
|
|
|
|
$html = file_get_contents($url);
|
|
|
|
$readability = new Readability($html, $url);
|
|
$result = $readability->init();
|
|
|
|
if ($result) {
|
|
header('Content-type: text/plain');
|
|
echo wordwrap($readability->getContent()->textContent);
|
|
}
|
|
else {
|
|
echo 'failed';
|
|
}
|
|
|