ssserver

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 18 Imported by: 0

README

Web screenshot server

CircleCI Go Report Card

Install the command with:

$ GO111MODULE=on go install -v github.com/koron/ssserver

Or:

$ go get -u -i github.com/koron/ssserver

Assure to install Chrome and Chrome driver.

Then start the server, it listen 3000 on localhost.

$ ssserver

Run these command from other terminal or console to obtain screenshots.

$ curl -v http://127.0.0.1:3000/?u=https://www.kaoriya.net/ -o kaoriya.png
$ curl -v http://127.0.0.1:3000/?u=http://tokyo-ame.jwa.or.jp/ -o ame.png

Requirements

These tools are required to make ssserver work correctly.

Install those to anywhere in you PATH environment variable.

Request Parameters

Name Description
u URL to take a screenshot (mandatory)
w Width of screenshot (default: 1024)
h Height of screenshot (default: 768)
wait Wait before take a screenshot (default: 0, see Duration)
sX Scroll offset X (default: 0)
sY Scroll offset Y (default: 0)
full Full page screenshot. Ignore h, sX and sY when set.
save Show save as dialog in browser. Imply Content-Disposition: attachment

Server Options

Name Description
-addr Server listen address (default: ":3000")
-driver WebDriver name (default: "chrome")
-maxpages Max number of browser instances (default: 4)
-v Verbose logging

Examples

Full page screenshot:

$ curl -v 'http://127.0.0.1:3000/?u=https://www.kaoriya.net/&full' -o kaoriya-full.png

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL