#!/usr/bin/perl -w

use strict;
use warnings;
use Carp;

use WebService::Browshot;

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


my $list = $browshot->screenshot_list(limit => 5, status => 'finished'); # last 5 screenshots
foreach my $id (keys %$list) {
	my $url = $list->{$id}->{final_url};
	print "#$id $url\n";
}


# Number of errors
$list = $browshot->screenshot_list(status => 'error');
print scalar(keys %$list), " of the last last 100 screenshots failed\n";