4

GitHub - alash3al/katch: a simple wrapper for headless chrome available via http...

 2 years ago
source link: https://github.com/alash3al/katch?v1_0_0=
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

katch!

a very simple wrapper utility for headless chrome to easily export any webpage as png, jpeg, pdf or html (prerender), you can use it via http or cli.

Usage

# run katch server in a separate terminal window
$ katch serve --listen=:3000
  • a screenshot from google.com?

http://localhost:3000/export?format=png&url=https://google.com

  • a screenshot but with a big screen?

http://localhost:3000/export?format=png&viewport_width=1300&viewport_height=1600&url=https://google.com

  • a pdf?

http://localhost:3000/export?format=pdf&viewport_width=1300&viewport_height=1600&url=https://google.com

  • limit execution time to 5 seconds?

http://localhost:3000/export?format=pdf&max_exec_time=5&viewport_width=1300&viewport_height=1600&url=https://google.com

NOTE: you can post JSON payload to the same endpoint with the same name as the above query params.

NOTE: for cli usage, please run $ katch help

Download ?

you can go to the releases page and pick the latest version. or you can $ docker run --rm -it ghcr.io/alash3al/katch katch help

Contribution ?

for sure you can contribute, how?

  • clone the repo
  • create your fix/feature branch
  • create a pull request

nothing else, enjoy!

About

I'm Mohamed Al Ashaal, a software engineer :)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK