Skip to content

Instantly share code, notes, and snippets.

@superbrothers
Last active May 10, 2019 08:05
Show Gist options
  • Save superbrothers/2c2d3713d8d30a785cabf77831489fcd to your computer and use it in GitHub Desktop.
Save superbrothers/2c2d3713d8d30a785cabf77831489fcd to your computer and use it in GitHub Desktop.
Download KubeCon + CloudNativeCon Europe 2018 presentations from Sched
#!/usr/bin/env bash
# Download KubeCon + CloudNativeCon Europe 2018 presentations from Sched
# Forked https://gist.github.com/hobbsh/35091c54970fff0b86a64cd72f02e8e3
DAYS=("2018-04-30" "2018-05-01" "2018-05-02" "2018-05-03" "2018-05-04")
for DAY in "${DAYS[@]}"; do
mkdir -p "kccnceu18/${DAY}"
LINKS=($(curl -s https://kccnceu18.sched.com/${DAY}/overview | grep -oEi "f='(.*)' cl" | cut -d\' -f 2 | tr '\n' ' '))
for LINK in "${LINKS[@]}"; do
echo "Requesting https://kccnceu18.sched.com/${LINK}"
FILE_URL=$(curl -s https://kccnceu18.sched.com${LINK} | grep "file-uploaded" | cut -d\" -f 4)
if [ -n "${FILE_URL}" ]; then
FILEPATH="kccnceu18/${DAY}/$(echo "${LINK}" | cut -d/ -f4).${FILE_URL##*.}"
if [[ ! -f "${FILEPATH}" ]]; then
echo "Downloading ${FILEPATH}"
curl -o "${FILEPATH}" -s "${FILE_URL}"
fi
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment