Return to Snippet

Revision: 57141
at May 17, 2012 23:17 by Maximus1983

Initial Code
 * The PHP file that takes the picture


//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
$id = $grabzIt->TakePicture("", "");

 * The GrabzItHandler file that saves the picture


$message = $_GET["message"];
$customId = $_GET["customid"];
$id = $_GET["id"];
$filename = $_GET["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.
file_put_contents("images" . DIRECTORY_SEPARATOR . $filename, $result);

Initial URL

Initial Description
Capture Web Screenshots easily with the [GrabzIt ]( PHP API

You will need the free [GrabzIt Code Library]( to get started.

Initial Title
Capture Screenshots in PHP

Initial Tags

Initial Language