GithubHelp home page GithubHelp logo

imgur.sh's Introduction

Bart's Imgur uploader bash script

Purpose

Upload images to Imgur via a small bash script.

History

This is the repository for the Bash script which has been found on Imgur's tools page since way back in 2009, and now on their new tools page.

I received infrequent but steady emails over the years with thanks and suggestions for improvements. A Google search shows the script has been reused and forked many times over the years. About time this had its own Git repository, so maybe the improvements can find their way back to the source.

Requirements

  • curl

Optional

  • xsel, xclip, or pbcopy, to automatically put the URLs on the X selection for easy pasting

Instructions

  1. Put it somewhere in your path and maybe rename it

     mv imgur.sh ~/bin/imgur
    

    Or you could make a symlink instead.

  2. Make it executable

     chmod +x ~/bin/imgur
    
  3. Optional, since I've provided a client ID: add your client id to the top of the script, replacing the provided one, or set it as the IMGUR_CLIENT_ID environment variable

Uploading images

  • Single image

      imgur images/hilarious/manfallingover.jpg
    
  • Single image from a URL

      imgur https://example.com/egg.png
    
  • Multiple images

      imgur images/delicious/cake.png https://example.com/exciting/bungeejump.jpg
    
  • Directly from a screenshot

      import png:- | imgur
    

    Note that the import command above is from Imagemagick, and will await a selection being made on screen.

The new URLs will be displayed (and the delete page URLs will be displayed on stderr). If you have xsel, xclip, or pbcopy, the URLs will also be put on the X selection, which you can then usually paste with a middle click.

If no filename is given, or if - is given as one of the arguments, an image is read from standard input.

Rate limits

There are some rate limits with the API. The daily upload limit is shared by everyone using the same client ID, so if you're using the provided one and start to get errors, you might consider using your own client ID.

imgur.sh's People

Contributors

tremby avatar ar1a avatar x89 avatar networkned avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.