Skip to content
/ hotshot Public
forked from innoq/hotshot

Takes screenshots of DOM elements

License

Notifications You must be signed in to change notification settings

womany/hotshot

 
 

Repository files navigation

Hotshot

Takes screenshots of DOM elements, like Jake Gyllenhaal 📸

Check out the blog post. forked from innoq/hotshot

We change to use a well-maintained image, which we don't need to maintain puppeteer by ourselves

Start (without Docker)

Make sure you've got a current node and yarn installed. Then:

$ yarn install
$ TARGET_HOST="https://www.womany.net" yarn start

Enable debug mode will start the Chromium in non-headless mode:

$ TARGET_HOST="https://www.womany.net" DEBUG_MODE=true yarn start

Start (with Docker)

Build image:

$ docker build -t womany/hotshot .

Remember to cleanup after building and sudo docker info tocheck if kernel opened memory limit function

Start server:

$ docker run -d -m 1G -p 5000:5000 -e PORT=5000 -e TIMEOUT=30000 -e TARGET_HOST='https://womany.net' womany/hotshot

d = daemon mode
m = memory limit, it will limit 1G memory and 1G swap
p = port mapping host:container
e = environment variable

Request a screenshot:

$ curl -G "https://maker.womany.net/shoot?path=genderpower%2fpedias%2f26187" > screenshot.png

$ curl -G "https://localhost:5000/shoot?path=genderpower%2fpedias%2f26187&selector=.genderpedia&padding=5&vpw=645" > screenshot.png

About

Takes screenshots of DOM elements

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 76.6%
  • Dockerfile 23.4%