加群链接需要idkey的,该源码自动解析idkey,实现免idkey加群。
该源码来自彩虹秒赞系统。
例如:api.yum6.cn/qqun.php?qun=463631294
1<?php 2/*免IDKEY加群 3*Author:消失的彩虹海 4*/ 5error_reporting(0); 6function get_curl($url, $post=0, $referer=0, $cookie=0, $header=0, $ua=0, $nobaody=0) 7{ 8 $ch = curl_init(); 9 curl_setopt($ch, CURLOPT_URL, $url); 10 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 11 if ($post) { 12 curl_setopt($ch, CURLOPT_POST, 1); 13 curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 14 } 15 if ($header) { 16 curl_setopt($ch, CURLOPT_HEADER, true); 17 } 18 if ($cookie) { 19 curl_setopt($ch, CURLOPT_COOKIE, $cookie); 20 } 21 if ($referer) { 22 curl_setopt($ch, CURLOPT_REFERER, $referer); 23 } 24 if ($ua) { 25 curl_setopt($ch, CURLOPT_USERAGENT, $ua); 26 } 27 else { 28 curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Linux; U; Android 4.0.4; es-mx; HTC_One_X Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0"); 29 } 30 if ($nobaody) { 31 curl_setopt($ch, CURLOPT_NOBODY, 1); 32 } 33 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 34 $ret = curl_exec($ch); 35 curl_close($ch); 36 return $ret; 37} 38$qun=isset($_GET['qun'])?$_GET['qun']:'326026548'; 39$data=get_curl('http://shang.qq.com/wpa/g_wpa_get?guin='.$qun.'&t='.time(),0,'http://qun.qq.com/join.html'); 40$arr=json_decode($data,true); 41$idkey=$arr['result']['data'][0]['key']; 42$url='http://shang.qq.com/wpa/qunwpa?idkey='.$idkey; 43header("Location:{$url}"); 44exit; 45?>