Created
September 26, 2019 14:47
-
-
Save mlist/4eda6d5d596d319b5f95eca8f55ce302 to your computer and use it in GitHub Desktop.
bash script to batch convert all insync gddoc files in a folder to PDF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#convert all gddoc documents to pdf | |
#needs jq: https://stedolan.github.io/jq/download/ | |
shopt -s nullglob | |
for g in *.gddoc | |
do | |
url=$(jq -c '.url' $g) | |
url="${url%/edit?usp=drivesdk\"}" | |
url="${url#\"}" | |
echo "converting $url" | |
target="${url}/export?format=pdf&size=7" | |
wget -O "${g%.*}.pdf" "$target" | |
echo "done." | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment