邀请QQ好友-QQ联系人导入(上)
2009-09-06 00:00:00 来源:WEB开发网项目中有个需求,要求能够导入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
更多精彩
赞助商链接