在python中从yahoo导入联系人
是否有官方方法可以从雅虎的用户地址簿导入联系人?
对于谷歌来说,这非常简单:
import gdata
contacts_service = gdata.contacts.service.ContactsService()
contacts_service.email = email
contacts_service.password = password
contacts_service.ProgrammaticLogin()
query = gdata.contacts.service.ContactsQuery()
query.max_results = GOOGLE_CONTACTS_MAX_RESULTS
entries = contacts_service.GetContactsFeed(query.ToUri())
雅虎有这么简单的方法吗?
我找到了一些不使用 api 的解决方案,对于严肃的游戏来说看起来很奇怪 - 例如 ContactGrabber。 我找到了在 django-friends 应用 中需要 BBAuth 令牌的解决方案。
但是,我想要官方、清晰的方式从雅虎获取用户联系人。它存在吗?
更新: 最后,我避免使用 yahoo api,并使用 django-openinviter 来达到我的目的。
但我仍在寻找使用 api 导入用户联系人的示例。
Is there are official way to import contacts from user address book from yahoo?
For google it's really simple as:
import gdata
contacts_service = gdata.contacts.service.ContactsService()
contacts_service.email = email
contacts_service.password = password
contacts_service.ProgrammaticLogin()
query = gdata.contacts.service.ContactsQuery()
query.max_results = GOOGLE_CONTACTS_MAX_RESULTS
entries = contacts_service.GetContactsFeed(query.ToUri())
Is there such simple way for yahoo?
I found some solutions, that don't use api and looks strange for serious game - for example ContactGrabber.
I found solutions, that require BBAuth Token in django-friends app.
But, I want official, clear, way to grab user contacts from yahoo. Does it exists?
UPD:
Finally I am avoiding use of yahoo api, and using django-openinviter for my purposes.
But I am still looking for examples of importing user contacts using api.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Contacts REST API 非常简单。您要查找的 URL 是
这是一个将为您提取内容的脚本。您可以扩展它以包括身份验证。
The Contacts REST API is pretty straight-forward. The URL that you're after is
Here is a script that will extract things for you. You can expand this to include authentication.
Yahoo 在此处提供了一些关于如何使用 Python 访问其 API 的不错的文档。那里的信息将告诉您如何通过 YQL 使用 http 请求访问 Yahoo API。这意味着直接执行 http GET 和 POST 并自行解析结果。然而,他们也有一个 python 库,可以在这里包装这些调用,但还没有自 2009 年 10 月 13 日起更新,因此您的里程可能会有所不同。
Yahoo has some decent documentation on how to access its APIs with Python here. The information there will tell you how to access Yahoo APIs by YQL with http requests. This means directly performing the http GETs and POSTs and parsing the results yourself. However, they also have a python library that wraps those calls here, but it has not been updated since 10/13/2009, so your mileage may vary.