Wednesday, February 17, 2010

picasa gdata API and face recognition

Tonight I wanted to download a list of photos from picasaweb with a particular person in them, using the "subjectids" field. I don't see any official way to do this, but here's how I managed it:

In picasaweb (in my web browser), I loaded up the page showing all the photos my friend was in. At the bottom, there was a little "RSS" link. That link looked like this:

I loaded that link in my browser, and it gave me the option to keep it as a live bookmark.

Instead, I trimmed the URL down and plunked it in this little python gdata script:


import gdata.geo

gd_client = = 'MY_EMAIL_ADDRESS'
gd_client.password = 'MY_PASSWORD'
gd_client.source = 'exampleCo-exampleApp-1'

print "logged in"

photos = gd_client.GetFeed('/data/feed/base/user/credentiality?kind=photo&subjectids=THE_SAME_BIG_LONG_STRING')

for photo in photos.entry:
print photo.content.src

That printed out a list of URLs to the images I wanted.


avigmati said...

thank you.

soku said...

Is this working still? I have trouble with this in .net, somebody can try this?

Anonymous said...

Worked fine for me just now. Did you remember to change "credentiality" to your username in the GetFeed call?