`

msn导出联系人文档

阅读更多
1:   申请windows application id,用来获取微软提供的读取api的云服务。



1》  进入页面http://msdn.microsoft.com/en-us/library/cc287659.aspx,登陆

2》  New Service --> Live Services: Existing APIs  --> I Agree

3》  添加信息





2:  http://github.com/mislav/contacts  下载gem包,这个gem包是依赖msn的api实现的导出msn联系人的功能,此外还有google和yahoo的导出联系人功能。



3:  打开config下的contacts.yml文件,配置application id的信息



4:    将插件放入项目的vendor下plugins



5:  由于设置了return_url,所以需要配置路由和host文件,windows会在验证完之后根据return_url来返回。

     例如:   map.resourcesingxis, :collection => {:contacts => :get}

              127.0.0.1    life.com



6:   主要方法



    @wll = Contacts::WindowsLive.new

    consenturl = @wll.get_authentication_url  返回一个url这个url可以跳转到windows live的登陆页面

    message_html = %{<a href="#{consenturl}">click here</a> }





    返回的action中

    wll = Contacts::WindowsLive.new

    @contacts = wll.contacts(params.merge("action" => "delauth").to_param)   所有联系人的信息,其中params.merge("action" => "delauth")中的"action" => "delauth"必需加上。





7:  相关api或其他



实例:http://www.365jizhang.com/api/liveInvite.do



http://msdn.microsoft.com/en-us/library/bb463989.aspx   官方api



http://www.kuqin.com/web/20090308/38689.html     用户实现过程(第一步跳过)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics