<?php

#######################
# WARNING
# Running this code sample will cost you Browshot credits
#######################

require 'vendor/autoload.php'; # Composer
# require_once 'Browshot.php'; # or download Browshot.php

$browshot = new Browshot('my_api_key');

# You must request HTML when creating the screenshot
$screenshot = $browshot->screenshot_create(array('url' => 'http://mobilio.net/', 'instance_id' => 24, 'screen_width' => 1280, 'screen_height' => 1024, 'html' => 1)); 
sleep(60);

$screenshot = $browshot->screenshot_info($screenshot->{'id'});
if ($screenshot->{'status'} == 'finished') {
	$html = $browshot->screenshot_html($screenshot->{'id'});
	if (strlen($html) > 0) {
		echo "HTML is available\n";
# 	echo "$html\n";
	}
}

?>