sephxd/php-readability

此包的最新版本(dev-master)没有可用的许可证信息。

支持阅读的乐趣 - PHP 版 Arc90 的 Readability:http://graceco.de/readability/

dev-master 2015-01-22 06:09 UTC

This package is not auto-updated.

Last update: 2024-09-28 16:31:07 UTC


README

支持阅读的乐趣

Arc90 的 Readability.js 的 PHP 版本。

要求

实时演示

http://graceco.de/readability/

用法

require 'lib/Readability.inc.php';

$Readability     = new Readability($html, $html_input_charset); // default charset is utf-8
$ReadabilityData = $Readability->getContent(); // throws an exception when no suitable content is found

// You can see more params by var_dump($ReadabilityData);
echo "<h1>".$ReadabilityData['title']."</h1>";
echo $ReadabilityData['content'];

PS:对于 Node.js 版本,您可以查看这个链接