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
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
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
$ 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