SkillAgentSearch skills...

Screenshot2slack

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

Install / Use

/learn @ryysud/Screenshot2slack
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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.<br> See https://github.com/GoogleChrome/puppeteer .

Requirements

  • Docker
  • Slack App (Go to https://my.slack.com/services/new/bot to create.)

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

View on GitHub
GitHub Stars8
CategoryDevelopment
Updated4y ago
Forks5

Languages

JavaScript

Security Score

75/100

Audited on Jul 17, 2021

No findings