Skip to content

Instantly share code, notes, and snippets.

@hobbsh
Created December 9, 2017 04:23
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save hobbsh/35091c54970fff0b86a64cd72f02e8e3 to your computer and use it in GitHub Desktop.
Save hobbsh/35091c54970fff0b86a64cd72f02e8e3 to your computer and use it in GitHub Desktop.
Download Kubecon Austin 2017 presentations from Sched
#!/bin/bash
DAYS=("2017-12-06" "2017-12-07" "2017-12-08")
for DAY in "${DAYS[@]}"; do
#Super shitty pipefest because of grep matched groups sadness
LINKS=($(curl https://kccncna17.sched.com/${DAY}/overview | grep -oEi "f='(.*)' cl" | cut -d\' -f 2 | tr '\n' ' '))
for LINK in "${LINKS[@]}"; do
echo "Requesting https://kccncna17.sched.com/${LINK}"
#Find file link on event page
FILE_URL=$(curl -s https://kccncna17.sched.com${LINK} | grep "file-uploaded" | cut -d\" -f 4)
#If there's an uploaded file on the page, download it
if [ -n "${FILE_URL}" ]; then
#Delete urlencoded spaces
FILENAME=`echo "${FILE_URL}" | cut -d/ -f7 | tr -d '%20'`
curl -o kubecon_files/${FILENAME} -s ${FILE_URL}
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment