PHP无权限QQ群链接生成,群分享源码

无言博客 574 2020-3-17
<?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);
}
END
文章标题:PHP无权限QQ群链接生成,群分享源码
原文链接:http://wuyubk.cn/post/28
若无特殊说明,本博客文章皆为原创,转载请注明出处

上篇文章:给文章添加点击特效
下篇文章:html或js中有趣的注释
标签:php
留言
落寞
2020-07-12 18:31
落寞到此一踩!
发表留言