【原创】PHP无权限生成QQ加群连接,群链接生成,QQ群链接生成,群分享源码

人恨话不多,直接贴代码,下面代码

<?php
/**
 * 获取QQ群连接
 * @param string $qun 群号
 * @return json
 * @example 调用方法 例: echo qun('936952391');
 * @author Reaper <a@0oo.ren>
 * @request https://www.52bz.la
 */
function qun($qun, $ref = 'https://qun.qq.com/proxy.html?callback=1&id=1')
{
    $ch = curl_init('https://qun.qq.com/proxy/domain/shang.qq.com/wpa/g_wpa_get?guin=' . $qun);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_REFERER, $ref);
    curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4 (compatible; Baiduspider/2.0; +https://www.52bz.la)');
    $content = curl_exec($ch);
    curl_close($ch);
    $data = json_decode($content, 1);
    $data = ['code' => 200, 'msg' => '获取成功!', 'data' => 'https://shang.qq.com/wpa/qunwpa?idkey=' . $data['result']['data'][0]["key"]];
    return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}
Last modification:October 10th, 2019 at 04:19 pm
如果觉得我的文章对你有用,请随意赞赏

Leave a Comment