Skip to content

Instantly share code, notes, and snippets.

@idiosync
Created March 29, 2012 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idiosync/2233045 to your computer and use it in GitHub Desktop.
Save idiosync/2233045 to your computer and use it in GitHub Desktop.
Upload a list of http accessible files to imgur
#!/bin/bash
read -p "Username: " username
read -p "Password: " -s password
echo
BASEURL=${1}
shift
curl -s -F "username=${username}" -F "password=${password}" -c /tmp/imgur_cookie.txt http://api.imgur.com/2/signin > /dev/null
for FILE in $* ; do
curl -F "image=@${BASEURL}/${FILE}" -F "title=${FILE%\.*}" -F "name=${FILE%\.*}" -b /tmp/imgur_cookie.txt http://api.imgur.com/2/account/images
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment