查询验证类型(官方)
<p>[TOC]</p>
<h5>简要描述</h5>
<ul>
<li>通过QQ号查询验证类型</li>
</ul>
<h5>请求URL{包含一个需要计算的参数}</h5>
<ul>
<li><a href="https://user.qzone.qq.com/proxy/domain/w.qzone.qq.com/cgi-bin/tfriend/friend_authfriend.cgi?g_tk=G_tk参数">https://user.qzone.qq.com/proxy/domain/w.qzone.qq.com/cgi-bin/tfriend/friend_authfriend.cgi?g_tk=G_tk参数</a></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>post</li>
</ul>
<h5>请求data</h5>
<ul>
<li>qzreferrer=https%3A%2F%2Fuser.qzone.qq.com%2F目标账号&sid=0&ouin=目标账号&uin=本人账号&fuin=目标账号&sourceId=1&fupdate=1 </li>
</ul>
<h5>是否需要Cookie</h5>
<ul>
<li>是</li>
<li>QQ空间Cookie 地址:<a href="https://user.qzone.qq.com/">https://user.qzone.qq.com/</a></li>
</ul>
<h5>是否需要协议头</h5>
<ul>
<li>否</li>
</ul>
<h5>G_tk计算(JS)</h5>
<ul>
<li>函数名:getG_tk</li>
<li>参数一:Cookie中的p_skey值 注意:不带值头</li>
<li>
<pre><code>function getG_tk(skey){var hash=5381;for(var i=0,len=skey.length;i&lt;len;++i){hash+=(hash&lt;&lt;5)+skey.charCodeAt(i);};return hash&amp;2147483647;}</code></pre>
</li>
</ul>
<h5>参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">qzreferrer</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>目标QQ空间地址</td>
</tr>
<tr>
<td style="text-align: left;">ouin</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>目标QQ</td>
</tr>
<tr>
<td style="text-align: left;">uin</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>取出Cookie的QQ</td>
</tr>
<tr>
<td style="text-align: left;">fuin</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>目标QQ</td>
</tr>
</tbody>
</table>
<h5>返回示例(需要取出Json解析)</h5>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var cb;try{document.domain=&quot;user.qzone.qq.com&quot;;cb=frameElement.callback;}catch(e){try{document.domain=&quot;user.qzone.qq.com&quot;;cb=frameElement.callback;}catch(e){document.domain=&quot;user.qzone.qq.com&quot;;cb=frameElement.callback;}}
frameElement.callback(
{
&quot;code&quot;:0,
&quot;subcode&quot;:0,
&quot;message&quot;:&quot;&quot;,
&quot;default&quot;:0,
&quot;data&quot;:
{&quot;state&quot;:3,
&quot;question&quot;:&quot;我公司的名字?&quot;}}
);
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td>0=成功</td>
</tr>
<tr>
<td style="text-align: left;">data.state</td>
<td style="text-align: left;">int</td>
<td>0=允许任何人 1=需要验证消息 2=禁止任何人 3=需要回答正确答案 4=需要回答问题并确认 5=已经是你的好友 6=账号不存在</td>
</tr>
<tr>
<td style="text-align: left;">data.question</td>
<td style="text-align: left;">text</td>
<td>验证类型=3 则 等于验证问题 验证类型=4 则 有多个问题</td>
</tr>
</tbody>
</table>
<h5>备注</h5>
<ul>
<li>接口限制{无}</li>
<li>接口返回如果编码异常请转换编码</li>
<li>接口需要使用账号cookie,多次快速频繁查询可能导致账号冻结</li>
<li>接口为官方接口,稳定性/速度性较强</li>
</ul>