Making HTML snapshots of Cobbled Pads for OSP

From Creative Crowds wiki
Jump to navigation Jump to search
# how to use this script?
# bash ./getcobbledpad.sh padname

PADID="cobbled-pad-$1"
APIKEY="aabac91dd54ef9e36aa7fc6e015556017ceb6b8398024cadff840ed69110a8c9"

echo "Getting the latest revision of: $PADID"
LATEST=$(curl -s "https://cc.practices.tools/pad/api/1.2.15/getRevisionsCount?apikey=$APIKEY&padID=$PADID" | jq -r ".data.revisions")
echo "This pad has this amount of revisions: $LATEST"

echo "Downloading the content of: $PADID"
curl -s "https://cc.practices.tools/pad/api/1.2.15/createDiffHTML?apikey=$APIKEY&padID=$PADID&startRev=0&endRev=$LATEST" | jq -r ".data.html" > $PADID.html
echo "<style>span.removed{display:none;} body{font-family:monospace;}</style>" >> $PADID.html

echo "Saved output to $PADID.html"
echo "Ready to send it to OSP friends :)"