aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-10-16 15:04:51 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-10-16 15:04:51 -0300
commit58228b69d454c835e90a4eb3219ac6a6653d0836 (patch)
treef43b54638365cec9604bf6eb610048831dc2c7ec /lib
parent73460c13773e040d75aa26b9ee6cd48c94649b79 (diff)
downloadhttruta-58228b69d454c835e90a4eb3219ac6a6653d0836.tar.gz
httruta-58228b69d454c835e90a4eb3219ac6a6653d0836.tar.bz2
Initial code for webkit2png and wkhtmltopdf
Diffstat (limited to 'lib')
-rw-r--r--lib/httracker/functions10
1 files changed, 10 insertions, 0 deletions
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..."