Sunday, August 12, 2007

YourGmailContacts.findAll{it.usePicasaweb()}

This groovy script checks an exported GMail contact list and find out whom on the list are using the Google Picasaweb to share photos. Download. View source

Why you create this script
Well, because some of my friends recently share photos on picasaweb but I am not aware of that until they send me the links. So far Picasa doesn't allow me to search the public albums among my GMail contacts.

How it works
First the user needs to export the Gmail contacts to a CSV file(HOWTO). Then specify the file path as the first parameter of this script, say C:>groovy picasaCheck C:\temp\gmail.csv . It will check each line and find out those gmail address. By leveraging the Picasa Web Albums Data API, it can easily verify whether those users are sharing public albums on picasa. The final result will be shown as a html file. Under the cover, this script will write a temp file and use groovy XML MarkupBuilder to add HTML code and open it using the system default browser. This blog explains how to launch the default browser in Windows/Linux/Mac.

Possible improvements
  • Get the gmail contacts via GTalk XMPP service. But I am doubt how many of you will type the gmail account in such an untrusted script -____-
  • Automatically add those contacts as picasa favorite. It's likely doable via the Picasa Web Albums Data API
  • Provide GUI. Not everyone likes command line tools, especially Windows users. SWING seems to be the only choice. But I prefer using the Groovy SWT module.
How to run
  1. Install JRE and Groovy if necessary
  2. Download the script and save the groovy file to any location
  3. Export your gmail contacts as CSV file
  4. Open a command line window and run groovy picasaCheck.groovy path.to.the.csv

No comments: