Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # edited by ItsMe
- # changes:
- # - third url ~> main url of imgur is returned, too
- # - colors ~> based on bash color codes
- # - process bar ~> default with progress
- # ~> if 2. argument is "np" - no progress
- #
- # imgur script by Bart Nagel <bart@tremby.net>
- # version 2
- # I release this as public domain. Do with it what you will.
- # Required: curl
- #
- # Optional: xsel or xclip for automatically putting the URL on the X selection
- # for easy pasting
- #
- # Instructions:
- # Put it somewhere in your path and maybe rename it:
- # mv ~/Downloads/imgur.sh ~/bin/imgur
- # Make it executable:
- # chmod x ~/bin/imgur
- # Stick your API key in the top:
- # vim ~/bin/imgur
- # Upload an image:
- # imgur images/hilarious/manfallingover.jpg
- # The URL will be displayed (and the delete page's URL will be displayed on
- # stderr). If you have xsel or xclip the URL will also be put on the X
- # selection, which you can usually paste with a middle click.
- # API Key provided by Alan@imgur.com
- #apikey="b3625162d3418ac51a9ee805b1840452"
- apikey="5a86dc503660d0675d2ce33f9003c2b5"
- # function to output usage instructions
- function usage {
- echo "Usage: $(basename $0) <filename> <np>
- Upload an image to imgur and output its new URL to stdout.
- If np (no process) is set, output has no process bar.
- Its main page is output to stderr.
- Its delete page is output to stderr.
- If xsel or xclip is available, the URL is put on the X selection for easy pasting." >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement