Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
t1csi authored Nov 26, 2018
1 parent 7883528 commit a4a78df
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions webkit2png-screenshots.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# I borrowed this script from here:
# https://gist.github.com/vvasabi/a266fc4e37e372a1ad8c

dir="$(pwd)"
output="$dir/output"

if [ ! -d $dir/output ]; then
mkdir "$dir/output"
fi

urls=`cat "$1"`

i=1
for url in $urls; do
# Convert url to file name
path=`echo $url | sed -e 's/http:\/\/domain\.name\///g'`
if [ -z $path ]; then
path=home
fi
escaped=`echo $path | sed -e 's/:\/\//_/g'`
printf -v filename "%03d-%s.png" $i "$escaped"

# Begin capture
echo "Generating $filename..."
webkit2png -o "$output/$filename" "$url" > /dev/null 2>&1
i=$(($i + 1))
done

0 comments on commit a4a78df

Please sign in to comment.