private image uploading
- create your account on imgur: http://imgur.com/
- create your app (API Client): https://api.imgur.com/oauth2/addclient
- Auth type is
OAuth 2 authorization without a callback URL
- copy the client-id and the client-secret
- Auth type is
the client-id and client-secret are stored on ~/.imgur/app.sh
like this
mkdir ~/.imgur
cd ~/.imgur
cat <<EOM > app.sh
CLIENT_ID={{client-id}}
CLIENT_SECRET={{client-secret}}
EOM
~/imgur/app.sh
will be sourced.
- auth your account with the client
- run
./imgur auth
- run
# upload a local image
$ imgur ./image.png
http://i.imgur.com/zzzzzzz.png
# upload via url
$ imgur --url http://example.co.jp/image.png
http://i.imgur.com/zzzzzzz.png
# title, description
$ imgur --title Houbunsha -D "2017/05/01 Morning" ./photo.jpg
http://i.imgur.com/zzzzzzz.png
$ imgur album create hoge
$ imgur album ls
TITLE ID DELETEHASH
hoge xxxxx yyyyyyyyyyyyyyy
$ imgur -A yyyyyyyyyyyyyyy ./image.jpg
http://i.imgur.com/zzzzzzz.png