承接 screenshotone/sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

screenshotone/sdk

最新稳定版本:v1.0.8

Composer 安装命令:

composer require screenshotone/sdk

包简介

A PHP SDK for the ScreenshotOne.com API to take screenshots of any URL

README 文档

README

Build Total Downloads

An official Screenshot API client for PHP.

It takes minutes to start taking screenshots. Just sign up to get access and secret keys, import the client, and you are ready to go.

The SDK client is synchronized with the latest screenshot API options.

Installation

composer require screenshotone/sdk:^1.0

Usage

Generate a screenshot URL without executing the request. Or download the screenshot. It is up to you:

<?php

// If you don't use Composer in your project, please, read https://getcomposer.org/doc/01-basic-usage.md#autoloading.
// You need the Composer autoloader to use the API SDK.

// ...

use ScreenshotOne\Sdk\Client;
use ScreenshotOne\Sdk\TakeOptions;

$client = new Client('<your access key>', '<your secret key>');

$options = TakeOptions::url("https://example.com")
    ->fullPage(true)
    ->delay(2)
    ->geolocationLatitude(48.857648)
    ->geolocationLongitude(2.294677)
    ->geolocationAccuracy(50);

$url = $client->generateTakeUrl($options);
echo $url.PHP_EOL;
// expected output: https://api.screenshotone.com/take?url=https%3A%2F%2Fexample.com...

$image = $client->take($options);
file_put_contents('example.png', $image);

Tests

Run:

$ composer run-script tests

Or:

$ vendor/bin/phpunit

License

screenshotone/phpsdk is released under the MIT license.

统计信息

  • 总下载量: 27.07k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-13