用户照片谷歌appengine

时间:2012-06-02 15:28:14

标签: google-app-engine google-contacts

我想从用户联系人在我的网络应用中显示用户图片。我有以下内容:

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+"'>")

我不知道为什么这不起作用,因为根据本指南,它产生的链接似乎是正确的https://developers.google.com/google-apps/contacts/v3/#retrieving_a_contacts_photo

https://www.google.com/m8/feeds/photos/media/currentlyautheduser%40gmail.com/27e1e1d70bb51465

并且gd_client似乎已正确刷新(我可以看到联系人其他详细信息......)

我的联系人客户端的代码如下

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

有什么想法吗?谢谢!

0 个答案:

没有答案
相关问题