dayrev/extractor

网页内容提取器

v1.2.2 2017-03-31 09:03 UTC

This package is not auto-updated.

Last update: 2024-09-21 14:47:20 UTC


README

Build Status Coverage Status Latest Stable Version

概述

Extractor提供了一个优雅的接口,通过多种第三方提供商从URL中提取内容。

支持的提供商

安装

运行以下 composer 命令将包添加到您的项目中

composer require dayrev/extractor

或者,将 "dayrev/extractor": "^1.0" 添加到您的 composer.json 文件中。

使用方法

$extractor = DayRev\Extractor\Provider::instance('embedly', ['api_key' => 'YOURKEYHERE']);
$content = $extractor->extract('http://www.espn.com/espn/wire/_/section/ncf/id/18398497');

测试

要从根目录运行测试套件,请运行以下命令

composer install
vendor/bin/phpunit -d embedly_api_key=YOUR_EMBEDLY_API_KEY

注意:在运行集成测试时需要有效的Embedly API密钥。