Skip to content

Instantly share code, notes, and snippets.

@etra0
Created December 13, 2016 03:36
Show Gist options
  • Save etra0/56747dce568852f29a648f56b33fb8c2 to your computer and use it in GitHub Desktop.
Save etra0/56747dce568852f29a648f56b33fb8c2 to your computer and use it in GitHub Desktop.
url=$1
album_id="${url##*/}"
json_data="`curl -s http://imgur.com/ajaxalbums/getimages/$album_id/hit.json`"
for line in $json_data; do
image_id="`echo $line | grep -o '"hash":"[A-Za-z0-9]*"' | perl -pe 's/"hash":"(.*)"/$1/g'`"
if [ ! -z $image_id ]; then
wget "i.imgur.com/$image_id.jpg"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment