使用 python Django 代码以编程方式登录 Yahoo/MSN(Hotmail) 并获取联系人列表?
有没有一种方法可以以编程方式登录 Yahoo!,提供电子邮件 ID 和密码作为输入,并获取用户的联系人?
我在 Gmail 上实现了同样的效果,使用 BeautifulSoup.py
Yahoo 地址簿 API 提供了 BBAuth,这需要将用户重定向到 Yahoo 登录页面。但我正在寻找一种无需重定向即可通过雅虎验证用户身份的方法。 我已经尝试过这个: http://pypi.python.org/pypi/ContactGrabber/0.1
但我得到这个错误:
警告(来自警告模块):文件 “C:\ Python26 \ lib \ site-packages \ contactgrabber-0.1-py2.6.egg \ contactgrabber \ base.py”, 第 31 行
运行时警告:tempnam 对您的程序存在潜在的安全风险
用户名/密码无效
异常WindowsError: (2, '系统找不到该文件 指定', 'C:\DOCUME~1\sjain\LOCALS~1\Temp\2') in >被忽略
Is there a way to programmatically log into Yahoo!, providing email id and password as inputs, and fetch the user's contacts?
I've achieved the same thing with Gmail, using BeautifulSoup.py
Yahoo Address book API provides BBAuth, which requires the user to be redirected to Yahoo login page. But I'm looking for a way to authenticate the user with Yahoo without the redirection.
I have tried this :
http://pypi.python.org/pypi/ContactGrabber/0.1
but I am getting this Error:
Warning (from warnings module): File
"C:\Python26\lib\site-packages\contactgrabber-0.1-py2.6.egg\contactgrabber\base.py",
line 31RuntimeWarning: tempnam is a potential security risk to your program
Invalid UserID/Password
Exception WindowsError: (2, 'The system cannot find the file
specified', 'C:\DOCUME~1\sjain\LOCALS~1\Temp\2') in > ignored
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过使用 Urllib 解决了这个问题,代码如下:
LoginUrl = "https://login.yahoo.com/config/login?"
ExportUrl = "http://address.yahoo.com/"
def import_yahoo_contacts(login,passwd):
这对我来说确实有用:)
I solved this problem by using Urllib here is the code :
LoginUrl = "https://login.yahoo.com/config/login?"
ExportUrl = "http://address.yahoo.com/"
def import_yahoo_contacts(login,passwd):
This really work for me :)
您可以编写一个或仅使用 Pinax。 Pinax 是构建在 Django 之上的工具集合。他们有一个导入联系人信息的应用程序(来自 vCard、Google 或 Yahoo)。
我建议您使用它,因为您不必维护它,并且可以避免重新发明循环。
You could write one or just use Pinax. Pinax is a collection of tools built on top of Django. They have a application which imports contact imfo (from vCard, Google or Yahoo).
I suggest you use this as you don't have to maintain it plus to avoid reinventing the cycle.