GitXplorerGitXplorer
G

grabzit

public
67 stars
34 forks
7 issues

Commits

List of commits on branch master.
Unverified
a100560fb292de627f209eee910c81f28ff5be30

Removed redundant method from ASP.NET

GGrabzIt committed 2 months ago
Unverified
945ca7a2f99b5468c5e8201529d1cf462167425b

Started move to full .net standard only with http client support

GGrabzIt committed 2 months ago
Unverified
80f584066c3ee146fe20ba125a08b56c9867b8cc

Minor text fixes

GGrabzIt committed 3 months ago
Unverified
51c64741414ffa3e4575be9435a0022c35835b65

Added fixes for python

GGrabzIt committed 5 months ago
Unverified
7a210c8c5a304ab3f8b8e6c5de38a60bbf806c76

Better documentation

GGrabzIt committed 9 months ago
Unverified
44dcf95e24243638e3fb8da2462ab6970a791632

Added WriteResultToStream method

GGrabzIt committed 9 months ago

README

The README file for this repository.

Convert the Web!

GrabzIt aspires to allow any programming language no matter how basic to turn a website or HTML into a fully rendered Image, video, PDF, DOCX. As well as converting HTML tables into JSON, XML, CSV or Excel and online videos into animated GIF's.

To do this we provide client libraries that enables a developer to create a capture, once complete, our server then sends a callback to your app to allow it to be processed.

While we currently support ASP.NET, Java, Javascript, Node.js, PHP, Perl, Python and Ruby we aim to create a library for as many programming languages as possible. If you would like to help us achieve this please do!

Example

We have made the programming libraries as simple as possible to use. To create a capture you must first call a method that specifies what you want to capture such as the URLToImage method followed by the Save method. You will need a application key and application secret, but you can get these for free from https://grabz.it.

include("GrabzItClient.php");

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

Notice that in the above example the location of the handler.php is defined this is used to handle the callback when the capture is complete.

The handler that accepts the callback and saves the image is below.

include("GrabzItClient.php");

$message = $_GET["message"];
$customId = $_GET["customid"];
$id = $_GET["id"];
$filename = $_GET["filename"];
$format = $_GET["format"];

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

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

if (!$result)
{
	return;
}

//Ensure that the application has the correct rights for this directory.
file_put_contents("results" . DIRECTORY_SEPARATOR . $filename, $result);

And that's it! Your website should now be taking screenshots!

Documentation

For further more in depth documentation go to https://grabz.it/api.