邀请QQ好友-QQ联系人导入(上) - 面向对象网,web开发,jsp,学习,对象 - 面向对象技术开发

面向对象技术开发

会员投稿 投稿指南 站长资讯通告:
您的位置: 首页 > Web开发 > Jsp > 正文

邀请QQ好友-QQ联系人导入(上)

来源: www.bianceng.cn 阅读:

项目中有个需求,要求能够导入MSN及QQ联系人。MSN的好说,有开源的jmsn及其它众多开源组件。可是QQ仍然是我行我素,至今也不开放API。虽然网上查到有lumaqq这样的开源

协议,可我Down下了折腾了半天,QQ都没有登录上去,好啦,我承认自己资质愚钝。时间紧迫,来不及仔细研究了,于是打起了QQ邮箱的主意~~

既然通过浏览器可以登录QQ邮箱,查看联系人,那么我们同样可以用程序模拟浏览器登录获取联系人。嗯,听起来不错,试试吧。

登录请求:

Http代码

POST /cgi-bin/login?sid=0,2,zh_CN HTTP/1.1
Host: m126.mail.qq.com 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; zh-CN; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729) 
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 
Accept-Language: zh-cn,zh;q=0.5 
Accept-Encoding: gzip,deflate 
Accept-Charset: gb2312,utf-8;q=0.7,*;q=0.7 
Keep-Alive: 300 
Connection: keep-alive 
Referer: http://mail.qq.com/cgi-bin/loginpage 
Cookie: verifysession=c6c09b326c4dac79b727c7e6e1069238e9bfe9ae6e7943e740a535af7cc57bddeacf1b617a15a912; pvid=5429125866; flv=10.0 r22; };

r_cookie=9828306541
Content-Type: application/x-www-form-urlencoded 
Content-Length: 371

sid=0%2C2%2Czh_CN&firstlogin=false&starttime=1251436516205&redirecturl=&f=html&p=UyoLX7JYspcnU9wCUK7qBA2Xjwo%2FO52FldnJnRABCnNLXI1ndwR8%2BQaepkT% 

2FIcKHxMshWv4SjrxgvRtA%2B1eHAookTXzcia%2FhP5QrRlGyNoqzVCi1X%2FsJwb4SmjPZRwV%2B7WeskUwClUfeNv%2BmCq0ygoNzi9UnIVeI7lYzgqXnxZE% 

3D&delegate_url=&s=&ts=1251436494&from=&uin=XXXXXXXX&aliastype=%40qq.com&pp=000000000&verifycode=qmpb 

响应:

Http代码

HTTP/1.1 200 OK 
Connection: close 
Date: Fri, 28 Aug 2009 05:15:18 GMT 
Content-Type: text/html; charset=gbk 
Set-Cookie:tinfo=1251436518.0550; Domain=mail.qq.com; Path=/
Set-Cookie:wimrefreshrun=; Domain=mail.qq.com; Path=/
Set-Cookie:autologin=EXPIRED; Domain=mail.qq.com; Path=/; Expires=Fri, 28-Aug-2009 05:17:18 GMT 
Set-Cookie:sid=; Domain=mail.qq.com; Path=/; Expires=Wed, 31-Dec-1969 23:59:59 GMT 
Set-Cookie:sid=6449e26f4adc402ac5c80e08bec3ca6c; Domain=mail.qq.com; Path=/
Set-Cookie:username=; Domain=mail.qq.com; Path=/; Expires=Wed, 31-Dec-1969 23:59:59 GMT 
Set-Cookie:username=XXXXXXXX; Domain=mail.qq.com; Path=/
Set-Cookie:qqmail_alias=XXXXXXXX@qq.com; Domain=mail.qq.com; Path=/
Set-Cookie:qqmail_sid=6449e26f4adc402ac5c80e08bec3ca6c; Domain=qq.com; Path=/
Set-Cookie:qqmail_username=XXXXXXXX; Domain=qq.com; Path=/
Set-Cookie:qqmail_domain=http://m126.mail.qq.com; Domain=qq.com; Path=/
Set-Cookie:qqmail_key=1_de7d3652ab10a1616175bf2aab152fb7010b0d06020602060309; Domain=qq.com; Path=/
Set-Cookie:CCSHOW=0000; Domain=mail.qq.com; Path=/; Expires=Sun, 28-Oct-2012 15:01:58 GMT 
Set-Cookie:noteorg=; Domain=mail.qq.com; Path=/; Expires=Sun, 28-Oct-2012 15:01:58 GMT 
Set-Cookie:foxacc=0; Domain=mail.qq.com; Path=/; Expires=Sun, 28-Oct-2012 15:01:58 GMT 
Set-Cookie:edition=4m126.mail.qq.com; Domain=mail.qq.com; Path=/; Expires=Sun, 28-Oct-2012 15:01:58 GMT 
Content-Encoding: gzip
Content-Length: 356 

Tags:
相关文章列表: