QQ城市达人接口编程及经验分享2--新接口
在我的上一篇关于城市达人的接口编程中《QQ城市达人接口编程及经验分享》,介绍了关于如何获取QQ号码的接口使用,这个接口是绝大多数QQ号码采集软件使用的,不过这个接口现在已经随着腾讯的屏蔽而失效,于是,QQ号码采集软件倒下一大批,所有在华军或者网上能查到的QQ号码采集软件,统统不能采集到数据。
我的软件“QQ号码采集及邮件管理系统”,采集号码之前也是用了这个原理,所以有短时间也是采集不了数据,好在众多使用客户的一再反映,才知道不知何因,腾讯取消了该接口的支持。
因此,要实现号码的采集,只能另辟高招了,通过分析城市达人:"http://city.qzone.qq.com/" 的查询原理,很快找到了解决的方法,更新了获取数据的接口以及Jason数据对象,终于又可以实现数据的采集了,不过接口数据和之前的有一定的差异,但是总体上还是不错的。
下面截取一个软件的界面来看看先。
下面说说接口数据的问题,通过工具对HTTP访问的分析,腾讯的数据接口从原来的连接字符串:
变为了:
通过新的接口获取到的数据大概是这样子的:
searchProCb({"responseHeader": {"status":"0","QTime":"21"},"response": {"numFound":"710","currentNum":"10","results":[
{"RQ":"1240719692","MD":"495094381","ID":"","XT":"1000000","DT":"1240719692","TI":"阳光帅气","UR":"http://city.qzone.qq.com/html/user/guest.htm#uin=495094381","QQ":"495094381","TA":"","CL":"","GA":"","GB":"0","GC":"1002","GD":"广东 韶关","GE":"不限 不限","GF":"1","GH":"1983","GI":"7","GJ":"0","GK":"0","GL":"4","GM":"173","GN":"6","GO":"3","GP":"1","GQ":"1","GR":"1","GS":"0","GT":"1","GU":"0","GV":"音乐达人 101000 时尚达人 105000 旅游达人 106000 摄影达人 112000 舞蹈达人 116000","GW":"0","GX":"","GY":"0","GZ":"0","HA":"http://daren4.store.qq.com/city/7c8c3001014d7e2ecf5662efbf1a2302p/1/2","HB":"http://daren1.store.qq.com/city/2931e30a6b4519ee62f5c4ab4bac94cbv/1/2","HC":"440203","HD":"0","HE":"0","HF":"","EX":"","DX":"0","TX":""},
{"RQ":"1189872826","MD":"569867770","ID":"","XT":"1000000","DT":"1221702571","TI":"当H5爱上N1","UR":"http://city.qzone.qq.com/html/user/guest.htm#uin=569867770","QQ":"569867770","TA":"","CL":"","GA":"空间算唔算? QQ游戏","GB":"19002200","GC":"530","GD":"广东 韶关","GE":"广东 韶关","GF":"1","GH":"1984","GI":"3","GJ":"2","GK":"42","GL":"3","GM":"173","GN":"6","GO":"3","GP":"2","GQ":"1","GR":"1","GS":"0","GT":"1","GU":"1","GV":"汽车达人 104000 游戏达人 107000 体育达人 115000 动漫达人 118000 篮球达人 115001","GW":"0","GX":"127029|广东,韶关,浈江区,,金源网吧|163971|广东,韶关,武江区,,五月花网络休闲会所|127029|广东,韶关,浈江区,,金源网吧","GY":"2","GZ":"84","HA":"http://daren2.store.qq.com/city/fd2c91ba6ad3e3762c8450dd933e5f46p/1/2","HB":"http://daren3.store.qq.com/city/dcfbb28121e43bd0abfcc31945314d36v/1/2","HC":"440203","HD":"440203","HE":"127029","HF":"127029 163971 127029","EX":"","DX":"0","TX":""}],"CorrectPin": [],"SimilarWords": []}});
{"RQ":"1240719692","MD":"495094381","ID":"","XT":"1000000","DT":"1240719692","TI":"阳光帅气","UR":"http://city.qzone.qq.com/html/user/guest.htm#uin=495094381","QQ":"495094381","TA":"","CL":"","GA":"","GB":"0","GC":"1002","GD":"广东 韶关","GE":"不限 不限","GF":"1","GH":"1983","GI":"7","GJ":"0","GK":"0","GL":"4","GM":"173","GN":"6","GO":"3","GP":"1","GQ":"1","GR":"1","GS":"0","GT":"1","GU":"0","GV":"音乐达人 101000 时尚达人 105000 旅游达人 106000 摄影达人 112000 舞蹈达人 116000","GW":"0","GX":"","GY":"0","GZ":"0","HA":"http://daren4.store.qq.com/city/7c8c3001014d7e2ecf5662efbf1a2302p/1/2","HB":"http://daren1.store.qq.com/city/2931e30a6b4519ee62f5c4ab4bac94cbv/1/2","HC":"440203","HD":"0","HE":"0","HF":"","EX":"","DX":"0","TX":""},
{"RQ":"1189872826","MD":"569867770","ID":"","XT":"1000000","DT":"1221702571","TI":"当H5爱上N1","UR":"http://city.qzone.qq.com/html/user/guest.htm#uin=569867770","QQ":"569867770","TA":"","CL":"","GA":"空间算唔算? QQ游戏","GB":"19002200","GC":"530","GD":"广东 韶关","GE":"广东 韶关","GF":"1","GH":"1984","GI":"3","GJ":"2","GK":"42","GL":"3","GM":"173","GN":"6","GO":"3","GP":"2","GQ":"1","GR":"1","GS":"0","GT":"1","GU":"1","GV":"汽车达人 104000 游戏达人 107000 体育达人 115000 动漫达人 118000 篮球达人 115001","GW":"0","GX":"127029|广东,韶关,浈江区,,金源网吧|163971|广东,韶关,武江区,,五月花网络休闲会所|127029|广东,韶关,浈江区,,金源网吧","GY":"2","GZ":"84","HA":"http://daren2.store.qq.com/city/fd2c91ba6ad3e3762c8450dd933e5f46p/1/2","HB":"http://daren3.store.qq.com/city/dcfbb28121e43bd0abfcc31945314d36v/1/2","HC":"440203","HD":"440203","HE":"127029","HF":"127029 163971 127029","EX":"","DX":"0","TX":""}],"CorrectPin": [],"SimilarWords": []}});
细细研究上面的字段,就可以发现里面的数据对应情况了,如QQ对应就是QQ号码(呵呵,废话),下面是我分析的一些说明,供参考,同时希望大家能够分析更多的字段信息出来:
TI:昵称
UR:详细介绍
QQ:号码
GD:想认识的人来自
GM:身高
GV:达人类型
HA:头像链接
HC:居住地
GH:出生年份
GF: 0女、1男
有了这些内容,我就基本上可以获取到一些有用的信息了。
通过修改截取数据的内容和实体类信息的构成,数据处理依然可以使用我原来的代码
List<QQData> entities = new List<QQData>();
try
{
entities = (List<QQData>)JavaScriptConvert.DeserializeObject(json, typeof(List<QQData>));
}
catch (Exception ex)
{
LogHelper.Error(ex);
}
try
{
entities = (List<QQData>)JavaScriptConvert.DeserializeObject(json, typeof(List<QQData>));
}
catch (Exception ex)
{
LogHelper.Error(ex);
}
希望大家能够多加讨论,获取更多有意义的数据和接口信息。
专注于代码生成工具、.Net/.NetCore 框架架构及软件开发,以及各种Vue.js的前端技术应用。著有Winform开发框架/混合式开发框架、微信开发框架、Bootstrap开发框架、ABP开发框架、SqlSugar开发框架等框架产品。
转载请注明出处:撰写人:伍华聪 http://www.iqidi.com
转载请注明出处:撰写人:伍华聪 http://www.iqidi.com