BoxLang 🚀 A New JVM Dynamic Language Learn More...

Urlbox Screenshots

v1.2.0 Modules

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

$ box install urlbox-screenshots

No collaborators yet.
     
  • {{ getFullDate("2022-01-07T21:28:48Z") }}
  • {{ getFullDate("2024-08-23T14:15:06Z") }}
  • 1,653
  • 2