clientbg/php-boiler-pipe

PhpBoilerPipe。从HTML页面中去除模板代码和提取全文。基于dotpack的PHP实现。

v1.1 2018-08-21 07:46 UTC

This package is not auto-updated.

Last update: 2024-09-15 05:23:03 UTC


README

  • 从 dotpack/php-boiler-pipe 分支出来

从HTML页面中去除模板代码和提取全文。

PHP中对https://github.com/kohlschutter/boilerpipe的部分实现。需要PHP >= 5.4。

示例

# html
$path = "http://example.com/some-article.html";
$data = file_get_contents($path);

# code
$ae = new Clientbg\PhpBoilerPipe\ArticleExtractor();
echo $ae->getContent($data) . "\n";