Skip to content

Instantly share code, notes, and snippets.

@fumiyas
Created September 7, 2014 07:36
Show Gist options
  • Save fumiyas/7924e400987e2f0d7524 to your computer and use it in GitHub Desktop.
Save fumiyas/7924e400987e2f0d7524 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -u
user="$1"; shift
wget \
--recursive \
--level=inf \
--span-hosts \
--no-timestamping \
--convert-links \
--accept-regex='^(http://twitpic\.com/(photos/'"$user"'\?page=[0-9]+|[a-zA-Z0-9]+(/full)?)|https://[a-z0-9]+\.cloudfront\.net/photos/large/[0-9]+\.[a-z]+\?[0-9]+)$' \
"http://twitpic.com/photos/$user?page=1" \
;
find *.cloudfront.net/photos/large/ -type f \
|sed 's/\(\(.*\)?.*\)/\1 \2/' \
|xargs -n2 mv \
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment