I would like to display user images in my web app from a users contacts. I have the following:
qry = gdata.contacts.client.ContactsQuery(max_results=10)
feed = gd_client.get_contacts(query=qry)
for cont in feed.entry:
self.response.out.write(cont.name)
photo = cont.GetPhotoLink().href
self.response.out.write("<img src='"+photo+"'>")
I have no idea why this isn't working as the links it produces seem right per this guide https://developers.google.com/google-apps/contacts/v3/#retrieving_a_contacts_photo
https://www.google.com/m8/feeds/photos/media/currentlyautheduser%40gmail.com/27e1e1d70bb51465
and the gd_client seems to be authed correctly (I can see the contacts other details...)
the code for my contacts client is as following
def AuthedContactsClient():
current_user = users.GetCurrentUser()
gd_client = gdata.contacts.client.ContactsClient(source=SETTINGS['APP_NAME'])
gd_client.ssl=True
access_token_key = 'access_token_%s' % current_user.user_id()
gd_client.auth_token = gdata.gauth.ae_load(access_token_key)
return gd_client
Any ideas? Thanks!