2008年7月23日星期三

A simple picasa synchronizer in console

I wrote a simple utility to synchronize local picture directory with picasa web album. I'm pleased to share it :)
Python code, 41 lines.

This is the wiki page for it. Welcome to download and enjoy it :)

Install

Install python gdata client

Download http://gdata-python-client.googlecode.com/files/gdata.py-1.1.1.zip and install it according to the http://code.google.com/apis/gdata/articles/python_client_lib.html

Download this utility

Download http://picasup.googlecode.com/svn/trunk/picUp/src/picup/picu.py , and copy it to wherever you like, such as /home/todwong/sandbox/python/picupy/picu.py

Register it into PATH

Create a shell script in $PATH, such as /home/todwong/bin/picupy, with the content:

python /home/todwong/sandbox/python/picupy/picu.py

and make this scrtip executable:

chmod +x /home/todwong/bin/picupy

Use

Go to your directory with your jpg files, such as

cd /home/todwong/pic/hangzhou/

execute this shell directly

picupy

which refers /home/todwong/bin/picupy

Input you picasa web account username and password.

If you have already got an album named hangzhou online, continue to use that album, else create a new album named hangzhou and use it.

Upload those JPG files in your local directory /home/todwong/pic/hangzhou/ and not in your online album hangzhou yet.

To some extent, this utility is a one-way synchronizer, synchronizing from local directory to online picasa web album, with the current directory name to be the album title, and with the name of each file in current directory to be the title of each photo in the album. It is quite easy to use, because except for the account info, nothing else you have to input. Synchronizing processes automatically.


Thanks to
http://code.google.com/apis/picasaweb

Welcome to subscribe with my blog
http://todwang.blogspot.com

2 条评论:

lwl 说...

有没有可能双向同步阿?
另外是否能增加一个功能,将当前目录的子目录和picasa目录的进行同步?

可可熊 说...

如果做成图形界面应该比较好,呵;