Not a Member Yet,
Click here to Register
How do you like the new design?
It's cool, great job
[tally: 70%] 70%
It's okay
[tally: 20%] 20%
Its OK but I liked the old layout better
[tally: 0%] 0%
Please bring the old one back
[tally: 10%] 10%

votes: 10

ID: 546
Viewed: 599
Added: Jun 27, 2012
Version: 1.0
Snippet uploaded by: Unknown
Written By: Maximus
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

Capture Web Screenshots easily with the GrabzIt Perl API. You will need the free GrabzIt Perl Code Library to get started.

For more information on the API visit.

http://grabz.it/api/perl/

Register to get your free Application Key and Application Secret.

http://grabz.it/register.aspx

<!---Head--->
none

<!---Body--->


     #
#The Perl file that takes the screenshot
#

#!/usr/bin/perl

use GrabzItClient;

#Create the GrabzItClient class
#Replace "APPLICATION KEY", "APPLICATION SECRET" with the values from your account!
$grabzIt = new GrabzItClient("APPLICATION KEY", "APPLICATION SECRET");
#Take the picture the method will return the unique identifier assigned to this task
$grabzIt->TakePicture("http://www.google.com", "http://www.example.com/GrabzItHandler.pl");

#
#This GrabzItHandler file handles the GrabzIt callback
#

#!/usr/bin/perl

use CGI;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use File::Spec;
use GrabzItClient;

$cgi = new CGI;

$message = $cgi->param("message");
$customId = $cgi->param("customid");
$id = $cgi->param("id");
$filename = $cgi->param("filename");

#Custom id can be used to store user ids or whatever is needed for the later processing of the resulting screenshot

$grabzIt = new GrabzItClient("APPLICATION KEY", "APPLICATION SECRET");
$result = $grabzIt->GetPicture($id);

if ($result)
{
#Ensure that the application has the correct rights for this directory.
open FILE, ">".File::Spec->catfile("images",$filename) or die $!;
binmode FILE;
print FILE $result;
close FILE;
}

print <<ENDOFTEXT;
HTTP/1.0 200 OK

ENDOFTEXT
exit(0);


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2017 snippetlibrary.com All Rights Reserved. Conditions