【问题标题】:Sync google contacts by group to a limited number of users按组将 google 联系人同步到有限数量的用户
【发布时间】:2012-12-04 01:27:59
【问题描述】:

我正在尝试构建一个托管在 GAE 的开源 python 代码,以按组将联系人同步到有限数量的用户。在 Web 界面中,用户将能够选择他们的组以及将与谁同步。

我了解市场上有很多具有相同功能的应用程序,但我的组织担心这些应用程序向第三方提供销售联系人。我们是一个非营利组织,因此代码可以托管在 google project 或 github 以供社区贡献。

(对不起,介绍太长了)

  • 最好的开始方式是什么?是否有可以扩展的具有类似功能的教程?
  • 比较两个 Contact 类型元素的最佳方法是什么?看看它们是否需要同步。
  • Contact kind 元素是否有最新更新?如果我想实施最后一次更新获胜?

谢谢!

【问题讨论】:

    标签: google-app-engine google-profiles-api


    【解决方案1】:

    我不知道任何专门用于同步和比较联系人的教程,但在https://developers.google.com/google-apps/contacts/v3/ 上有一个 Google 联系人 API 入门指南。

    联系人作为 XML blob 发送,因此您可以通过解析两个联系人并查看其中的各个元素来比较两个联系人。我认为没有更好的方法可以做到这一点,但有一些库可以为您处理。

    在使用 API 检索联系人时,会发送一个最后更新的字段作为联系人的一部分。它是一个标记为 <updated> 的 XML 元素。

    【讨论】:

      【解决方案2】:
      how are you getting different user's contacts feeds?
      
      i tried to save the tokens in the datastore when the
      users grant the access, but when i get the token back
      from datastore for 2 users at a time, after an hour
      when the token expires, 
      all tokens start working like the current users token
      and i can only get current users contacts.
      
      token = Get_Shared_User_Token(user_email)
      contact_client = gdata.contacts.client.ContactsClient(source=USER_AGENT)
      authorized_client = token.authorize(contact_client)
      
      contacts_feed = authorized_client.GetContacts(q = query)
      
      can you please tell how one can get any user's contacts?
      

      【讨论】:

      • 这看起来不像是对原始问题的回答。也许您应该将此作为评论发布,甚至作为新问题发布?
      • 很抱歉,我是第一次使用 stackoverflow,但我找不到如何提问。当我点击提问时,它会将我带到我可以搜索的页面,我仍在尝试搜索
      猜你喜欢
      • 2018-05-28
      • 1970-01-01
      • 1970-01-01
      • 2011-10-09
      • 2017-07-10
      • 2019-02-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-17
      相关资源
      最近更新 更多