Upload Images to Imgur via Right Click Menu
  • rfry85rfry85
    PMPosts: 210
    http://imgur.com/LPG95Ct.jpg


    And after a few seconds you should get this...

    http://imgur.com/p6Q1UK9.jpg


    Just copy and paste the url into a browser, email, this forum, or wherever you wish. But if you do in this forum, remember to append .jpg to the url.


    Okay, here's how it's done.

    In your file manager, navigate to wherever you keep, or want to keep a script. Now create a new empty file. Put this on the very first row...

    ##! /bin/sh

    Remove the first #, once you have it copied. Now below that copy and paste this...

    TEXT=$(curl -F "image"=@"$1" -F "key"="a3793a1cce95f32435bb002b92e0fa5e" http://imgur.com/api/upload.xml | sed -e "s/.*<imgur_page>//" | sed -e "s/<.*//")
    zenity --info --title="Imgur Upload" --text="$TEXT"


    Now save and close your new script (you can name it imgur). Now lets make it executable, just right click it and select properties, then the permission tab, then change execute to "anyone" . 

    To add it to pcmanfm's right click menu, go to menu/system/fm custom actions


    ***Note:A quick warning. Fm Custom Actions seems to be a little flaky. So I
    recommend that you save your action after every line, to avoid having to
    retype to many entries. This app seems to, for no apparent reason
    suddenly stop saving information, at which point you just have to
    restart it. But after you get your action set up they work just fine.

    When It opens...

    1. Create a new action: Click on the Button under the File menu.
    2. Select the "Action"tab : Give it a name (something like "Imgur"). Give it an Icon or not. Make sure that "Display action in selection context menu" is checked, and "Display Item in location context menu is not".
    3. Select the "command" tab: Change the Path to     bash "/home/path/to/your/script/script-name"     Change the Parameters to    %f 
    4. Select the "Mimetype" filter tab: Change   *     to       image/*     press enter after doing so.
    5. Select the "scheme" tab: Change      *       to          file       press enter when done.
    6 Select the "Environment" tab": Change the count to      =(equal to)     1   (in the little box beside)    
    7. Select the "Properties" tab: Enter        ST Imgur       in the discription box (this probably is optional but safer to just do it).

    Now log out and back in, right click on an image file, and hopefully you will have an Imgur option. Then click on it. If all goes well, after a few seconds an url to your image should appear in a box. Just copy and paste it in whatever app you choose.




    Thanked by 1lxle