BoxLang 🚀 A New JVM Dynamic Language Learn More...
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.
You can install this project with CommandBox:
box install urlbox-screenshots
Alternatively, you can copy the models/urlbox.cfc
file into your project.
// 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!
Available options can be found here: urlbox.io/docs
$
box install urlbox-screenshots