#!/usr/bin/perl -w

use strict;
use warnings;
use Carp;

use WebService::Browshot;

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


my $browshot = WebService::Browshot->new(
	key	=> 'my_api_key',
	debug	=> 0, # no more debug information
);


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

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

