/ Published in: Perl
Capture Web Screenshots easily with the [GrabzIt Perl API](http://grabz.it/api/perl/)
You will need the free [GrabzIt Code Library](http://grabz.it/api/perl/download.aspx) to get started.
You will need the free [GrabzIt Code Library](http://grabz.it/api/perl/download.aspx) to get started.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# #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 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. binmode FILE; close FILE; } print <<ENDOFTEXT; HTTP/1.0 200 OK ENDOFTEXT
URL: http://grabz.it/api/perl/