Activity Stream
48,167 MEMBERS
6506 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 4 of 4
  1.     
    #1
    mmm mmm!

    Default Imgur image upload GUI script

    Here is a Yad GUI script for uploading an image from your computer to imgur.com image hosting and generates links needed for easy cut and paste into forum posts etc.



    script (requires Yad) name it imgur and put it in PATH /usr/bin/ or /root/my-applications/bin/

    Code: 
    #!/bin/bash 
    
    ###GUI for imgur script by Bart Nagel <bart@tremby.net>### 
    ###upload local image to www.imgur.com image hosting service### 
    ##Stu90### 
    # 
    
      ### root password for user fido ### 
      [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} 
    
    
    TEXT=" Select an image to upload to www.imgur.com " 
    NAME="Imgur upload" 
    VER="0.1" 
    
    
    GUI1=$(yad --title="$NAME $VER" --text="$TEXT" --form --field="Image:FL" --button="gtk-quit:1" --button="gtk-ok:0") 
    
    BUTTON=$? 
    
       if [ "$GUI1" = "" ]; then 
       echo "Exiting" && exit 
       fi 
    
    case $BUTTON in 
    0) 
    
    
    GETIMG="`echo $GUI1 | cut -d '|' -f 1`" 
    echo "$GETIMG" 
    
    # API Key provided by Alan@imgur.com 
    apikey="b3625162d3418ac51a9ee805b1840452" 
    
    # upload the image 
    response=$(curl -F "key=$apikey" -H "Expect: " -F "image=@$GETIMG" \ 
            http://imgur.com/api/upload.xml 2>/dev/null) 
    # the "Expect: " header is to get around a problem when using this through the 
    # Squid proxy. Not sure if it's a Squid bug or what. 
    if [ $? -ne 0 ]; then 
            echo "Upload failed" >&2 
            exit 2 
    elif [ $(echo $response | grep -c "<error_msg>") -gt 0 ]; then 
            echo "Error message from imgur:" >&2 
            echo $response | sed -r 's/.*<error_msg>(.*)<\/error_msg>.*/\1/' >&2 
            exit 3 
    fi 
    
    # parse the response and output our stuff 
    url=$(echo $response | sed -r 's/.*<original_image>(.*)<\/original_image>.*/\1/') 
    deleteurl=$(echo $response | sed -r 's/.*<delete_page>(.*)<\/delete_page>.*/\1/') 
    echo $url 
    echo "Delete page: $deleteurl" >&2 
    
    ##thumb nail image## 
    url1="` echo $url |  cut -d "." -f -3 `" 
    format="` echo $url |  cut -d "." -f 4- `" 
    urlthumb="$url1"l."$format" 
    
    
    ##imge links gui## 
    GUI2=$(yad --title="$NAME $VER" --text=" Cut and paste one of the image options from the boxes below " --form \ 
    --field="Forum Thumb" "[IMG]$urlthumb[/IMG]" \ 
    --field="Forum Full" "[IMG]$url[/IMG]" \ 
    --field="Direct URL" "$url" \ 
    --field="Delete page" "$deleteurl" \ 
    --button="gtk-quit") 
    
       if [ "$GUI2" = "" ]; then 
       echo "Exiting" && exit 
       fi 
    
    ;; 
        
    1) 
        echo "Quit selected - Exiting" && exit 
    ;; 
    esac
    All credits to stu90 and Bart Nagel.
    Daniel Reviewed by Daniel on . Imgur image upload GUI script Here is a Yad GUI script for uploading an image from your computer to imgur.com image hosting and generates links needed for easy cut and paste into forum posts etc. http://i.imgur.com/7iEFKl.png script (requires Yad) name it imgur and put it in PATH /usr/bin/ or /root/my-applications/bin/ #!/bin/bash ###GUI for imgur script by Bart Nagel <bart@tremby.net>### ###upload local image to www.imgur.com image hosting service### Rating: 5
    HATERS GONNA probably bring up some valid points considering I am an ignorant little twat so far up my own ass that i blame my problems on everyone and if you criticize me you're automatically wrong.

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    Bharat's Avatar
    Website's:
    ShineServers.Com Pickadedi.com
    Nice , but at most of the instances imgur uploder failed to upload

  4.     
    #3
    Member
    Website's:
    iFunMaza.com
    great one will definitely give it a try!

    OffTopic:
    +1 bharat

    FB - http://www.facebook.com/IfunMaza
    Twitter - twitter.com/#!/iFunMaza

  5.     
    #4
    Member
    Thanks gonna try
    Signature against the rules, removed. ~ Jason.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Image upload script
    By rayzen921 in forum Web Application/Script Support
    Replies: 3
    Last Post: 11th Mar 2012, 06:17 PM
  2. Looking for script image upload and short url.
    By blondul in forum Webmaster Resources
    Replies: 1
    Last Post: 17th Jan 2012, 12:58 PM
  3. imgur script
    By Zero - HosterBin in forum Webmaster Discussion
    Replies: 1
    Last Post: 16th Jan 2012, 10:29 PM
  4. [Shared] Need a host accept upload image/photos script
    By ARN.ADN in forum Archive
    Replies: 11
    Last Post: 21st Jun 2011, 06:31 AM
  5. Image Remote Upload Script
    By Hillside in forum Web Development Area
    Replies: 11
    Last Post: 6th Mar 2011, 06:45 PM

Tags for this Thread

BE SOCIAL