wnx/screeenly-client
最新稳定版本:v2.0.2
Composer 安装命令:
composer require wnx/screeenly-client
包简介
PHP API Wrapper for screeenly.com
README 文档
README
PHP Wrapper for the Screeenly API. You must have a Screeenly account to use this package.
Important notice: This package has been abandoned! I want to focus on more useful projects and the screeenly API is already very easy to use.
Installation
Install the package with composer:
Guzzle v6:
$ composer require "wnx/screeenly-client:~2.0"
Guzzle v5:
$ composer require "wnx/screeenly-client:~1.0"
For Laravel 4 prjoects:
$ composer require "wnx/screeenly-client:~0.3"
Usage
Laravel 5
Read more for Laravel 4 usage.
Add the following code to your providers array in app/conifg/app.php:
... 'Wnx\ScreeenlyClient\ScreeenlyClientServiceProvider',
Publish the configration file and add your Screeenly API Key in config/screeenly_client.php.
php artisan vendor:publish --provider="Wnx\ScreeenlyClient\ScreeenlyClientServiceProvider"
Now you have access to the Screenshot Facade. Use it like the example below:
$path = public_path('/'); $screenshot = Screenshot::capture('http://google.com'); $localPath = $screenshot->store($path, 'screenshot.jpg');
Non-Laravel Usage
use Wnx\ScreeenlyClient\Screenshot; ... $screenshot = new Screenshot($key); $screenshot->capture('http://google.com'); $localPath = $screenshot->store('path/to/image/store/', 'screenshot.jpg');
Available Methods
$screeenshot->capture($url);
Create Screenshot of given URL.
$screeenshot->store($path, $filename);
Store screenshot on local disk. Returns path to image.
$screeenshot->setHeight(integer);
Optional. Set screenshot height.
$screeenshot->setWidth(integer);
Optional. Set screenshot width.
$screeenshot->getPath();
Return path to temporary image on Screeenly server.
$screeenshot->getBase64();
Return base64-string for screenshot.
License
MIT
统计信息
- 总下载量: 31.83k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-13