Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.35 KB

README.md

File metadata and controls

41 lines (27 loc) · 1.35 KB

urlbox-screenshots

Quickly generate screenshots using the urlbox.io screenshot-as-a-service API.

This project follows the example of the official Urlbox node and php repositories and generates the Urlbox urls, but does not actually make the request for the screenshot.

Signup at Urlbox.io to get your API key and secret.

Installation

You can install this project with CommandBox:

box install urlbox-screenshots

Alternatively, you can copy the models/urlbox.cfc file into your project.

Example

// Get your API key and secret from urlbox.io
urlbox = new models.urlbox(YOUR_API_KEY, YOUR_API_SECRET);

// See all urlbox screenshot options at urlbox.io/docs
url = 'github.com';
options = {
  thumb_width: 600,
  format: 'jpg',
  quality: 80
}

imgUrl = urlbox.buildUrl( url, options );
// https://api.urlbox.io/v1/YOUR_API_KEY/TOKEN/jpg?url=github.com&quality=80&thumb_width=600

Now stick that url in an img tag to render the screenshot!

Urlbox Screenshot of github.com

Available options can be found here: urlbox.io/docs