Skip to content

Instantly share code, notes, and snippets.

@nv1t
Last active September 10, 2015 01:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nv1t/78b406fe0b4374233807 to your computer and use it in GitHub Desktop.
Save nv1t/78b406fe0b4374233807 to your computer and use it in GitHub Desktop.
slideshare-download.sh
#!/bin/bash
URL="${1}"
TITLE=$(echo $URL | awk -F"/" '{ print $NF }' | awk -F"?" '{ print $1 }')
mkdir -p "${TITLE}"
cd "${TITLE}"
for i in $(curl "${URL}" 2> /dev/null | grep "slide_image" | tr '"' "\n" | grep -A 1 "data-full" | grep "image.slidesharecdn"); do
echo -n "${i} ... "
wget -q $(echo "${i}" | awk -F"?" '{ print $1 }')
echo "DONE"
done;
digits=$(($(ls | wc -l | wc -c)-1))
find . -name '*.jpg' | sort -V | awk 'BEGIN{ a=1 }{ printf "mv \"%s\" %0'${digits}'d.jpg\n", $0, a++ }' | bash
@voyeg3r
Copy link

voyeg3r commented Sep 10, 2015

Great script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment