17
May

Picup: A Keyword Scanning Script to Synchronize or Upload Photos to an Online Gallery

Picup is a script that scans for photos that match a specified keyword and then uploads it to a gallery on a remote server. Although this script serves a specific purpose to myself, I believe it will be very handy for others to use as well. There is only one dependency: rsync and sh, meaning it will run on just about any UNIX system like Linux or Mac OSX.

Download picup
(Right-Click and “Save Link As…”)

I’ve included two options for getting your photos uploaded to a website: 1.) directly upload the photos that have been found that match the keyword and 2.) synchronize all the photos (even the untagged photos) to a general location on the server and then have the cream of the crop (photos marked with keyword) displayed in another location on the server such as a gallery. The picup script works quite well with photo gallery websites like ZenPhoto where a database is not necessary and photos can be directly uploaded to an album folder such as /public_html/zenphoto/albums/.

There are many other options available as well that can be easily configured. These are all documented in the configuration file called picup_config which is automatically generated and populated with examples when the script is ran for the first time.

Here’s an example run to give you a better idea of what the script actually does:

$ picup 
Searching for pictures marked with "favorites" in:
/MyFiles/Pictures/2010/05 - May/
This might take a while depending on the amount of files in directory...
2010/05 - May/My Pictures in May/IMG_0001.jpg
2010/05 - May/My Pictures in May/IMG_0002.jpg
2010/05 - May/My Pictures in May/IMG_0003.jpg
Please VERIFY the steps that are ABOUT TO BE EXECUTED!
This script is about to synchronize the directory
   /MyFiles/Pictures/
with the remote site
   [email protected]:/home/username/public_html/pictures
with the options of
   -avzh -e ssh --numeric-ids -i --delete-after --exclude-from=/MyFiles/Pictures/excludes
which will appear on the server as
   /home/username/public_html/pictures/2010/05 - May/My Pictures in May/IMG_0001.jpg
When finished, the following command will ran on the server
   ln -s "/home/username/public_html/pictures/2010/05 - May/My Pictures in May/IMG_0001.jpg" "/home/username/public_html/gallery/albums/2010/05 - May/My Pictures in May/IMG_0001.jpg"

Do you wish to continue? <yes,no> yes
building file list ... done
<rsync output snipped>

Uploading and executing script on server...
server_exec                                   100% 1071     1.1KB/s   00:00    
Finished uploading your pictures.  Enjoy!
$ 

I hope you find some use in this script. One of the goals that I was working hard for was to make this as easy as possible to use as well as keep the script speedy in execution. If you have questions, please let me know. I’d like to know if this gets any attention in the ZenPhoto community or elsewhere.

Also, if you’ve seen my old embarrassment of the picup script , I believe this to be a massive improvement.

Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:


There's 0 Comment So Far

Share your thoughts, leave a comment!