ncwilde43
June 20th, 2010, 05:52 AM
Since Google released the GoogleCL (http://google-opensource.blogspot.com/2010/06/introducing-google-command-line-tool.html) package, I decided to create a Nautilus script that quickly uploads an image to my Drop Box album in Picasaweb.
Note: The zenity progress bar does not work and is used only to show that the script is running.
Instructions for installation:
Save the code to your ~/.gnome2/nautilus-scripts directory
Make the script executable.
chmod +x ~/.gnome2/nautilus-scripts/Upload-Image
Restart Nautilus
nautilus -q
For those of you that haven't linked your GoogleCL library and Google account, open up the Terminal and enter the following command:
google picasa list title --title "Drop Box"Follow the link given to authenticate GoogleCL.
Save the following code to ~/.gnome2/nautilus-scripts/Image-Upload
#!/bin/bash
FILENAME=$*
FULLPATH=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
## ---Check to see if GoogleCL is installed
if [ $(which google | wc -l) -eq 0 ] ; then
zenity --error --title "Picasa Uploader" --text "GoogleCL is not installed!"
exit 1
fi
## ---Upload image - Zenity progress bar does not work properly.
google picasa post --title "Drop Box" $FULLPATH | zenity --progress --pulsate --auto-close --auto-kill --percentage=50 --title "Upload" --text "Uploading $FILENAME . . ." --width 350 --height 25
## ---Check to see if image uploaded successfully and show notification
if [ $(google picasa list title --title "Drop Box" | grep $FILENAME | wc -l) -eq 1 ] ; then
zenity --info --title "Complete" --text "Upload of $FILENAME complete!" --height 15
else
zenity --error --title "Error" --text "Upload of $FILENAME failed!" --height 15
fiIf anyone can figure out how to get the zenity progress bar to work, that would be great!
Note: The zenity progress bar does not work and is used only to show that the script is running.
Instructions for installation:
Save the code to your ~/.gnome2/nautilus-scripts directory
Make the script executable.
chmod +x ~/.gnome2/nautilus-scripts/Upload-Image
Restart Nautilus
nautilus -q
For those of you that haven't linked your GoogleCL library and Google account, open up the Terminal and enter the following command:
google picasa list title --title "Drop Box"Follow the link given to authenticate GoogleCL.
Save the following code to ~/.gnome2/nautilus-scripts/Image-Upload
#!/bin/bash
FILENAME=$*
FULLPATH=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
## ---Check to see if GoogleCL is installed
if [ $(which google | wc -l) -eq 0 ] ; then
zenity --error --title "Picasa Uploader" --text "GoogleCL is not installed!"
exit 1
fi
## ---Upload image - Zenity progress bar does not work properly.
google picasa post --title "Drop Box" $FULLPATH | zenity --progress --pulsate --auto-close --auto-kill --percentage=50 --title "Upload" --text "Uploading $FILENAME . . ." --width 350 --height 25
## ---Check to see if image uploaded successfully and show notification
if [ $(google picasa list title --title "Drop Box" | grep $FILENAME | wc -l) -eq 1 ] ; then
zenity --info --title "Complete" --text "Upload of $FILENAME complete!" --height 15
else
zenity --error --title "Error" --text "Upload of $FILENAME failed!" --height 15
fiIf anyone can figure out how to get the zenity progress bar to work, that would be great!