From 58228b69d454c835e90a4eb3219ac6a6653d0836 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 16 Oct 2015 15:04:51 -0300 Subject: Initial code for webkit2png and wkhtmltopdf --- lib/httracker/functions | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/httracker/functions') diff --git a/lib/httracker/functions b/lib/httracker/functions index d847769..ce3dd29 100644 --- a/lib/httracker/functions +++ b/lib/httracker/functions @@ -66,6 +66,16 @@ function httracker_get { rm -rf $TARGET fi + # Get a screenshot + if [ "$WEBKIT2PNG" == "1" ]; then + $DIRNAME/webkit2png/webkit2png/webkit2png.py -o $TARGET/screenshot.png "$url" + fi + + # Build a PDF + if [ "$WKHTMLTOPDF" == "1" ] && which wkhtmltopdf &> /dev/null; then + wkhtmltopdf "$url" $TARGET/screenshot.pdf + fi + # Fix permissions again if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then echo "Fixing $TARGET permissions..." -- cgit v1.2.3