Martin Kavalar / Jun 27 2018
Screenshotting with Chrome
Screenshotting with Chrome
(use '[clojure.java.shell :only [sh]]) (defn screenshot [url] (sh "google-chrome" "--headless" "--disable-gpu" "--no-sandbox" "--virtual-time-budget=25000" "--screenshot=/results/screenshot.png" (str "https://staging.nextjournal.com/" url "?preview=1")))
(screenshot "mk/mandelbrot")
(screenshot "mk/papers-we-will-love")
google-chrome --headless --disable-gpu --no-sandbox --virtual-time-budget=25000 --screenshot=/results/screenshot.png "https://nextjournal.com/mk/mandelbrot-II?preview=1"
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' apt-get update apt-get -y install google-chrome-stable apt-get purge