An easy-to-use PHP library for the Browserstack Screenshots API forked from alexschwarz89/browserstack.
Working examples included.
Install via composer:
{
"require": {
"linchpinagency/browserstack": "0.0.3"
}
}
Run composer install
.
use Linchpin\Browserstack\Screenshots\ScreenshotsAPI;
$screenshots_api = new ScreenshotsAPI( 'username', 'password' );
$browser_list = $api->get_browsers();
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;
$status = $api->get_job_status( 'browserstack_jobID' );
if ( $status->is_finished() ) {
foreach ( $status->finished_screenshots as $screenshot ) {
print $screenshot->image_url ."\n";
}
}