Skip to content

linchpin/browserstack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browserstack Screenshot API PHP Library

An easy-to-use PHP library for the Browserstack Screenshots API forked from alexschwarz89/browserstack.

Working examples included.

Install

Install via composer:

{
    "require": {
        "linchpinagency/browserstack": "0.0.3"
    }
}

Run composer install.

Example usage

Get an array of available browsers

use Linchpin\Browserstack\Screenshots\ScreenshotsAPI;
$screenshots_api = new ScreenshotsAPI( 'username', 'password' );
$browser_list    = $api->get_browsers();

Generate a screenshot

use Linchpin\Browserstack\Screenshots\ScreenshotsAPI;
use Linchpin\Browserstack\Screenshots\Request;
$screenshots_api = new ScreenshotsAPI( 'account', 'password' );
$request         = Request::build_request( 'http://www.example.org', 'Windows', '8.1', 'ie', '11.0' );
$response        = $screenshots_api->send_request( $request );
$job_ID          = $response->job_ID;

Query information about the request

$status = $api->get_job_status( 'browserstack_jobID' );
if ( $status->is_finished() ) {
  foreach ( $status->finished_screenshots as $screenshot ) {
    print $screenshot->image_url ."\n";
  }
}

About

PHP Library for accessing the Browserstack Screenshots API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%