- 浏览: 105424 次
- 性别:
- 来自: 上海
最新评论
-
18335864773:
用过一次用pageoffice产品生成excel。其实利用Pa ...
java导出多个excel并打成zip包 -
lujialiang:
writeEmailInfo2Excel() 这个方法怎么写 ...
java导出多个excel并打成zip包 -
zhaokui:
,用到了,太感谢了
DES加密 java与.net可以相互加密解密两种方法 -
fengpy2009:
灰常感谢啊
DES加密 java与.net可以相互加密解密两种方法
http://code.google.com/p/contact-list/
获取用户的msn和邮箱联系人列表,支持的邮箱包括hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah, 189和139。
contactlist项目首页和jar包下载在http://code.google.com/p/contact-list/
contactlist项目源代码在http://github.com/flyerhzm/contactlist , google code svn不再更新
Service:
contactlist提供web api调用,必须使用HTTP POST请求,接口如下:
url : https : //123.183.209.87:8443/ContactListService/contacts parameters : account = xxx@gmail . com & password = xxxx & type = gmail
返回json格式如下:
正确的结果:
{ 'contacts' : [{ 'username' : 'yyy' , 'email' : 'yyy@gmail.com' }, { 'username' : 'zzz' , 'email' : 'zzz@hotmail.com' }]}
错误的结果:
{ 'error' : 'hotmail protocol changed' }
ruby客户端: http://github.com/flyerhzm/contactlist-client
web客户端: http://contactlist.heroku.com
Example:
try { ContactsImporter importer = ContactsImporterFactory . getHotmailContacts ( username , password ); List < Contact > contacts = importer . getContacts (); for ( Contact contact : contacts ) { System . out . println ( contact . getUsername () + ": " + contact . getEmail ()); } } catch ( ContactsException ex ) { ex . printStackTrace (); }
Encoding:
项目的输出统一为UTF-8。 对于运行在locale为UTF-8环境(如:Ubuntu, Mac OS X)下的程序,无需任何调整。 对于运行在locale为GBK环境(如:Windows XP)下的程序,需要手动调整编码:
try { ContactsImporter importer = ContactsImporterFactory . getHotmailContacts ( username , password ); List < Contact > contacts = importer . getContacts (); for ( Contact contact : contacts ) { String username = new String ( contact . getUsername (). getBytes ( "UTF-8" ), "GBK" ); System . out . println ( username + ": " + contact . getEmail ()); } } catch ( ContactsException ex ) { ex . printStackTrace (); }
另外,在windows下面需要把项目的编码设置为UTF-8,并且确保java文件的编译是用UTF-8的
Project Introduction:
contact-list类库依赖包之commons-httpclient -- http://www.huangzhimin.com/entries/142-contact-list-library-dependency-of-commons-httpclient
contact-list类库依赖包之msnmlib -- http://www.huangzhimin.com/entries/147-contact-list-library-dependency-of-msnmlib
contact-list类库依赖包之json -- http://www.huangzhimin.com/entries/158-contact-list-of-the-json-library-dependency
contact-list类库依赖包之gdata -- http://www.huangzhimin.com/entries/162-contact-list-of-the-gdata-library-dependency
持续更新中...
How to run unit test:
出于安全的考虑,没有把单元测试中的邮箱配置文件和msn配置文件放到svn上,如果需要运行mvn test的话,可以按以下步骤:
1. 新建src/test/resources/email.properties文件,形式如下:
gmail . username = xxx@gmail . com gmail . password = yyy hotmail . username = xxx@hotmail . com hotmail . password = yyy livecn . username = xxx@live . cn livecn . password = yyy onesixthree . username = xxx@163 . com onesixthree . password = yyy onetwosix . username = xxx@126 . com onetwosix . password = yyy sina . username = xxx@sina . com sina . password = yyy sohu . username = xxx@sohu . com sohu . password = yyy tom . username = xxx@tom . com tom . password = yyy yahoo . username = xxx@yahoo . com yahoo . password = yyy yahoocn . username = xxx@yahoo . cn yahoocn . password = yyy yahoocomcn . username = xxx@yahoo . com . cn yahoocomcn . password = yyy yeah . username = xxx@yeah . net yeah . password = yyy oneeightnine . username = xxx@189 . cn oneeightnine . password = yyy onethreenine . username = xxx@139 . com oneeightnine . password = yyy
2. 新建src/test/resources/msn.properties文件,形式如下:
username = xxx@live . cn password = yyy
3. 在命令行执行mvn test
Change Log:
- 1.1:
First public release
- 1.2:
Fix issue that hotmail can only get first page contact list
- 1.3:
Fix issue for some special sohu mail account
- 1.4:
Fix issue that 163 mail can only get other group contacts
- 1.5:
Fix issue that 126 and yeah mail can only get other group contacts
- 1.6:
Add 189 and 139 mail support
- 1.6.1:
Meet another style 189 mail and add 139 mail importer to ContactsImporterFactory
- 1.7.0:
Get google contacts by gdata api
- 1.8.0:
Get hotmail contacts by windows live contacts api
- 1.9.0:
Better parser for yahoo and tom mail
- 1.10.0:
Use passportName as email for hotmail
- 1.11.0:
Fix 139 for web change and fix 126 and yeah mail when username is empty
- 1.12.0:
Get msn contacts by window live contacts api
Other:
需要留言的话,可以上http://github.com/flyerhzm/contactlist/issues ,我会尽快回复的
由 于这个类库的原理是使用抓取网页来分析联系人列表的,所以会因为邮箱网页的改版而无法正确获取联系人列表。 如果大家在使用的时候发现有邮箱不能获得联系人列表,希望先把类库log4j的level设置为debug,把调试信息和错误信息一起发送给我 flyerhzm@gmail.com,我会尽快解决问题的,谢谢!
发表评论
-
禁止网站复制代码操作
2011-10-24 13:44 8091.在<body>中加入如下的代码,这样鼠标的左右 ... -
Java操作Cookie
2011-09-02 09:52 1553Java对cookie的操作比较简 ... -
抽象类与接口的区别
2011-08-26 17:12 693abstract class和interface是Ja ... -
网站上线之前需要检查的13个问题
2011-08-22 09:44 6901、用了Google ... -
java导出多个excel并打成zip包
2011-08-03 10:09 18659这里主要是要针对数据量过大,通过生成多个excel文件并打成一 ... -
OAuth简介
2011-07-19 14:15 1223本篇说说关于OAuth授权认证的事情,新浪开放api都必须在 ... -
poi读取Excel2007文件
2011-06-16 11:16 2181excel2007同之前excel97-2003在存储数据量上 ... -
java读取property.property文件
2011-06-14 09:35 2263import java.io.IOException; im ... -
Java生成excel文件 JXL
2011-05-24 17:13 2339要使用的jar包 jxl-2.5.7.jar ... -
Apache+PHP+MySQL安装配置全过程(支持win7)
2011-05-11 15:02 1210Apache+PHP+MySQL安装配置全 ... -
用于输出object对象中的属性值
2011-04-26 10:46 1605import java.lang.reflect.Invoca ... -
checkbox勾选后禁用其他html组建
2011-02-18 16:37 927<input type='checkbox' name= ... -
<select>标签解决只读状态下无法传递值到后台问题
2011-02-18 16:27 1124function SetReadOnly(id){ ... -
停机广告
2010-07-26 10:01 853<%@ page language="java ... -
java 生成任意位数随机数
2010-07-06 11:16 2050/** * 生成任意位数随机数 * @param ... -
如何获取<iframe>中的src属性
2010-03-22 14:50 6821这里写了一个获取iframe中的src的url地址并将其修改 ... -
DES加密 java与.net可以相互加密解密两种方法
2010-03-02 17:34 3597通过这个方法可以实现java和C#相互加密与解密 并能保持解密 ... -
cookie机制和session机制
2010-03-01 13:05 636一、cookie ... -
token解决重复提交问题
2009-12-15 15:32 1249如果避免重复提交呢? 请知道的详细说下,或者把文章的链接 ... -
ognl表达式访问普通属性和静态方法
2009-12-09 13:41 1329ognl的全名是 Object-Graph N ...
相关推荐
完整版本,整合了包括读取邮箱通讯录、MSN好友列表的的功能,目前读取邮箱通讯录支持如下邮箱:gmail(Y)、hotmail(Y)、live(Y)、tom(Y)、yahoo(Y)(有点慢)、sina(Y)、163(Y)、126(Y)、yeah(Y)、sohu(Y) 读取后可以...
完整版本,整合了包括读取邮箱通讯录、MSN好友列表的的功能,目前读取邮箱通讯录支持如下邮箱:gmail(Y)、hotmail(Y)、live(Y)、tom(Y)、yahoo(Y)(有点慢)、sina(Y)、163(Y)、126(Y)、yeah(Y)、sohu(Y) 读取后可以...
完整版本,整合了包括读取邮箱通讯录、MSN好友列表的的功能,目前读取邮箱通讯录支持如下邮箱:gmail(Y)、hotmail(Y)、live(Y)、tom(Y)、yahoo(Y)(有点慢)、sina(Y)、163(Y)、126(Y)、yeah(Y)、sohu(Y) 读取后可以...
C# 读取各大邮箱的通讯录(联系人),包括:gmail、hotmail、live、sina、sohu、163、126、tom、yeah、yahoo等邮箱均能正常读取。 同时也包括 MSN好友列表
支持,gmail,yahoo,sohu,sina,tom等邮箱通讯录导入,以及msn联系人导入
支持好多种邮箱, sina.com 163.com 126.com yeah.net gmail.com hotmail.com sohu.com tom.com yahoo.com yahoo.com.cn yahoo.cn, 另外有获取msn好友列表的方法。 这个是dll,源码在我的另外一个资源中 新手,代码...
此资源包含GMAIL,126,163,HotMail,sina,sohu,tom,yahoo,yeah,msn等主流邮箱和MSN通讯录的导入,其中修复了大多数126,163网站无法获取通讯录的BUG 本人再次声名,此资源绝对能用,除非最近163又改地址了
完整版本,整合了包括读取邮箱通讯录、MSN好友列表的的功能,目前读取邮箱通讯录支持如下邮箱:gmail(Y)、hotmail(Y)、live(Y)、tom(Y)、yahoo(Y)(有点慢)、sina(Y)、163(Y)、126(Y)、yeah(Y)、sohu(Y) 读取后可以...
整合了包括读取邮箱通讯录、MSN好友列表的的功能,目前读取邮箱通讯录支持如下邮箱:gmail(Y)、hotmail(Y)、 live(Y)、tom(Y)、yahoo(Y)(有点慢)、 sina(Y)、163(Y)、126(Y)、yeah(Y)、sohu(Y) 读取后可以发送邮件...
支持 163.com 126.com yeah.net sina.com hotmail.com gmail.com live.cn yahoo.cn yahoo.com.cn sohu.com tom.com
你不用担心你有多少个电子邮件帐号只要轻轻一按登陆,163 126 188 sohu, yahoo,tom,21cn,sina gmail,qq,hotmail,tianya,baidu 的电子邮件可同时登陆再多的电子邮件帐号也不怕电子邮件管理好方便