Skip to content

Creating Your First Capture

Scott Behrens edited this page Aug 5, 2014 · 4 revisions

Now that you have Sketchy installed, let's go ahead and retrieve a capture!

We will use Eager Mode to retrieve a sketch. Eager mode blocks, so we don't need to do anything special with regards to implementing a client for the API.

Creating Captures in a Test Setup

In test, we haven't setup SSL or Nginx, so you will need to hit the application via it's host:port over HTTP.

Create a Sketch

http://your_IP:your_port/eager?url=http://google.com&type=sketch

PhantomJS is called to retrieve a screenshot of google.com.

Create a Scrape

http://your_IP:your_port/eager?url=http://google.com&type=scrape

PhantomJS is called to retrieve a scrape of google.com, which contains all text from the site with html tags and javascript code removed.

Create a HTML

http://your_IP:your_port/eager?url=http://google.com&type=html

PhantomJS is called to retrieve the rendered html file from the url provided.

Creating Captures in a Production Setup

Assuming you have setup SSL and Nginx, you can use the following to test out creating captures in Production.

Create a Sketch

https://127.0.0.1/eager?url=http://google.com&type=sketch

PhantomJS is called to retrieve a screenshot of google.com.

Create a Scrape

https://127.0.0.1/eager?url=http://google.com&type=scrape

PhantomJS is called to retrieve a scrape of google.com, which contains all text from the site with html tags and javascript code removed.

Create a HTML

https://127.0.0.1/eager?url=http://google.com&type=html

PhantomJS is called to retrieve the rendered html file from the url provided.

What now?

Now that you have created some captures, take a look at Sketchy's Configuration and API Documentation to leverage all the powerful features of Sketchy!