Name: screenshotter
Owner: Lucify
Description: A Node server that takes screenshots of websites with pageres
Created: 2016-08-22 14:47:29.0
Updated: 2017-04-26 12:42:55.0
Pushed: 2017-05-15 11:41:42.0
Size: 41
Language: TypeScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Node server that takes screenshots of websites with pageres.
install
start # listens on port 8090 by default
POST /save
Saves screenshots of url
with dimensions sizes
to the directory dest
in the server's local filesystem.
rface Payload {
l: string;
st: string;
zes?: string[]; // defaults to ["1024x768"]
ilOnWarnings?: boolean; // defaults to false
tions?: PageresOptions;
POST /stream
Streams a screenshot of url
with dimensions size
.
rface Payload {
l: string;
ze?: string; // defaults to "1024x768"
tions?: PageresOptions;
rface PageresOptions {
lay?: number;
meout?: number;
op?: boolean;
s?: string;
ript?: string;
okies?: string[];
lename?: string; // https://github.com/sindresorhus/pageres#filename
crementalName?: boolean;
lector?: string;
de?: string[];
ername?: string;
ssword?: string;
ale?: number; // 1
rmat?: 'png' | 'jpg'; // png
erAgent?: string;
aders?: object;
t defaultPageresOptions: PageresOptions = {
lay: 0,
meout: 30,
ale: 1,
rmat: 'png',
crementalName: false,
op: true,
Start the screenshotter at localhost:8090
with
er-compose up
-r -d '' BODY <<EOF
rl": "https://google.com",
est": "/screenshots",
izes": ["1024x768", "1920x1200"],
ptions": {
"scale": 2
$BODY | curl -v -H "Content-Type: application/json" -d '@-' localhost:8090/save
There should now exist two PNGs at test/tmp
.
-r -d '' BODY <<EOF
rl": "https://google.com",
ptions": {
"scale": 2
$BODY | curl -v -H "Content-Type: application/json" -d '@-' localhost:8090/stream > screenshot.png