weseek / screenshot2slack

screenshot2slack is a tool uploading a screenshot to slack with puppeteer on docker.

Home Page:https://reboooot.net/post/enjoy-puppeteer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

screenshot2slack

Tags Docker Build Status Docker Pulls License

Overview

screenshot2slack is a tool uploading a screenshot to slack with puppeteer on docker.

Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol.
See https://github.com/GoogleChrome/puppeteer .

Requirements

Usage

Getting started

$ docker run --rm \
    -e SLACK_BOT_TOKEN=xxx-xxx-xxx \
    -e CHANNEL=your-channel \
    ryysud/screenshot2slack:latest

Specify URL, width and height

$ docker run --rm \
    -e SLACK_BOT_TOKEN=xxx-xxx-xxx \
    -e CHANNEL=your-channel \
    -e TARGET_URL=https://github.com/ryysud/screenshot2slack \
    -e WIDTH=1920 \
    -e HEIGHT=1080 \
    ryysud/screenshot2slack:latest

Via Basic authentication

$ docker run --rm \
    -e SLACK_BOT_TOKEN=xxx-xxx-xxx \
    -e CHANNEL=your-channel \
    -e TARGET_URL=https://example.com/path/to/basic-authentication-page \
    -e BASIC_AUTH_USERNAME=username \
    -e BASIC_AUTH_PASSWORD=password \
    ryysud/screenshot2slack:latest

Environment Variables

Name Description Required Default
SLACK_BOT_TOKEN Token string to post to slack. -
TARGET_URL Screen shot target URL. - https://github.com
FILE_NAME File name to post. - example.png
WIDTH Width of browser. - 1280
HEIGHT Height of browser. - 768
FULL_PAGE When true, takes a screenshot of the full scrollable page. - false
CHANNEL Slack channel name to post. - general
BASIC_AUTH_USERNAME Username to pass basic authentication. - null
BASIC_AUTH_PASSWORD Password to pass basic authentication. - null
COOKIES JSON Array string to pass to browser. - null
SCREENSHOT_DELAY_SEC Number of seconds to delay time to take screenshot. - null

Example of COOKIES

[
    {"name": "_session", "value": "xxx", ...},
    {"name": "foo", "value": "bar", ...},
    ...
]

See Puppeteer Docs.

License

About

screenshot2slack is a tool uploading a screenshot to slack with puppeteer on docker.

https://reboooot.net/post/enjoy-puppeteer/

License:Apache License 2.0


Languages

Language:JavaScript 77.9%Language:Dockerfile 22.1%