Powered By

Powered by Blogger

Sabtu, 26 Desember 2009

Upload Image To Imgur: Nautilus Actions Script [Linux]

cozzyd (Multumesc, Cosmin) Reddit user wrote a simple Nautilus Actions script to upload images to Imgur.com via right click.

To use it, make sure you have nautilus-actions, zenity and curl installed. In Ubuntu, install them using this command:
sudo apt-get install nautilus-actions zenity curl


Then, to set up the script, follow these steps:

1. Download the script and the .schema files from HERE.

2. Place the script wherever you want, and make it executable:
chmod +x imgur_upload


3. Go to System > Preferences > Nautilus Actions Configuration, select Tools > Import Assistant and select the downloaded .schema file.

4. Edit the command to point to where the imgur_upload script is located:

upload to imgur nautilus actions settings

Please note that the Nautilus Actions Configuration under Ubuntu Karmic looks different then it used to (I've just noticed this myself).

Once you have completed this, click the second button on the left called "Record all the modified actions".


You should now see an "Upload to Imgur" option when right clicking an image:


upload to imgur

And after uploading, a dialog should display the image url:

imgur


Note: if you don't use Nautilus, another reddit user (downdiagonal) come up with a curl command you can use to upload images to Imgur via command line. Simply add this to your .bashrc file (it should be in your home folder):

imgur(){
for i in "$@";do
curl -# -F "image"=@"$i" -F "key"="4907fcd89e761c6b07eeb8292d5a9b2a" http://imgur.com/api/upload.xml|\
grep -Eo '<[a-z_]+>http[^<]+'|sed 's/^<.\|_./\U&/g;s/_/ /;s/<\(.*\)>/\x1B[0;34m\1:\x1B[0m /'
done
}



After that, reload bashrc with this command:
bash


Then, to upload an image to Imgur via command line, simply type:
imgur /path/to/image.jpg


The output will be something like this:
######################################################################## 100.0%
Original Image: http://imgur.com/dZ2iK.jpg
Large Thumbnail: http://imgur.com/dZ2iKl.jpg
Small Thumbnail: http://imgur.com/dZ2iKs.png
Imgur Page: http://imgur.com/dZ2iK
Delete Page: http://imgur.com/delete/hSvCvEt7uq


[via reddit]

Tidak ada komentar:

Posting Komentar