7

Is there any software that can help me upload images directly to imgur.com?

Command line applications would be preferable.

3 Answers 3

10

Imgur provides tools for this. You can even download a shell script from imgur.com which works from the command line.

Of course, installing software directly instead of using Ubuntu's official repository opens a security hole which makes GNU/Linux vulnerable to trojan malware. While usually not recommended, you can still do it, if you want to. Here's how.

First, if you do not have a personal bin directory to store executables, create one by running the following commands:

cd
mkdir bin
source .profile

To download and install the imgur script, run the following commands (you do not need to be root):

wget http://imgur.com/tools/imgurbash.sh
chmod a+x imgurbash.sh
mv imgurbash.sh ~/bin/imgur

Now, simply run imgur with the path to an image to upload it to Imgur.

For example:

imgur /usr/share/banshee/icons/hicolor/128x128/devices/phone-google-nexus-one.png

This gives the following output:

http://i.imgur.com/SoIwv.png
Delete page: http://imgur.com/delete/VTtZOI9LOhtZ2oB
Haven't copied to the clipboard: no $DISPLAY

The first line is the link to the Imgur page, and the second line is the link to delete the image you just uploaded. If possible, the script will also copy the Imgur url to the clipboard for immediate use.

Enjoy!

[Note: this answer previously suggested running the commands as root in order to put the imgur script into /bin. Using root should be avoided whenever possible. In this case, we can create a user's personal ~/bin directory. It's an extra step, but the security is worth it.]

1
  • +1 thanks a lot !! but ill wait for other answers
    – Ashu
    Jun 5, 2012 at 16:36
8

If you don't mind using a GUI:

shutter Install shutter is a feature-rich screenshot program. You can take a screenshot of a specific area, window, your whole screen, or even of a website – apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window.

Edit > Preferences

Preferences dialog

0
3

I'm using a slightly modified version of Sirupsen's Linux Screenshot Uploader script : https://gist.github.com/2941720

Install it like this:

curl https://imgur.com/tools/imgurbash.sh > ~/bin/imgur && chmod 755 ~/bin/imgur &&
curl https://gist.github.com/raw/2941720/shoot.sh > ~/bin/shoot && chmod 755 ~/bin/shoot

and call it (assuming ~/bin is in your PATH) with shoot. Select the area of the screen you want to capture by drawing a rectangle around it and it'll capture that, upload to imgur and tell you the URL.

It internally uses imgurbash.sh but has a workaround if you don't want to install that dependency.

2
  • yes, indeed very good. It is not working as it is though. My proposed fixes are: sudo apt-get install scrot -y && mkdir -p ~/bin/ && ...your part. Cheers!
    – Rho
    Feb 23, 2014 at 8:24
  • ANd it seems that the "shoot" raw link is also mistaken. I'm using this instead: gist.githubusercontent.com/kynan/2941720/raw/…
    – Rho
    Feb 23, 2014 at 9:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .